home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / windows2 / hp22d1.zip / ADDEN2_2.DOC next >
Text File  |  1991-05-22  |  123KB  |  4,237 lines

  1.                               H Y P E R P A D                      Version 2.2
  2.                              FILE: ADDEN2_2.DOC                    20 May 1991
  3.  
  4.                          Addendum for Version 2.2
  5.                          ~~~~~~~~~~~~~~~~~~~~~~~~
  6.     Copyright 1989-1991 by Brightbill-Roberts & Co.  All rights reserved.
  7.  
  8.  
  9.               ┌─────────┐
  10.         ┌─────┴───┐     │               (R)
  11.       ──│         │o    │──────────────────
  12.         │   ┌─────┴╨──┐ │  Association of
  13.         │   │         │─┘  Shareware
  14.         └───│    o    │    Professionals
  15.       ──────│    ║    │────────────────────
  16.             └────╨────┘    MEMBER
  17.                      
  18.  
  19. ┌──────────────────────────────────────────────────────────────────────────┐
  20. │   Brightbill-Roberts & Co.        │      Phone:  (315) 474-3400          │
  21. │   421 University Building         │      Fax:          472─1732          │
  22. │   120 East Washington Street      │      BBS:          472─1058          │
  23. │   Syracuse, NY    13202-4000      │      Compuserve:  75300,363          │
  24. └──────────────────────────────────────────────────────────────────────────┘
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31. This document supercedes and augments the information found in the HyperPAD
  32. User's Guide and Reference Guide. This addendum describes the changes and
  33. enhancements that were implemented in version 2.2 from the previous version
  34. (2.0) described in the main documentation.
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.        Table of Contents
  45.  
  46.  
  47.             Getting Started ................................2
  48.               System Requirements ..........................2
  49.               Converting Pads to HyperPAD 2.2 File Format ..2
  50.               Installation .................................3
  51.             Microsoft Windows Support ......................6
  52.             New Command Line Parameters ....................8
  53.             Support for Read-Only Pads .....................13
  54.             Customizable Menus .............................14
  55.               Differences from HyperPAD 2.0 ................14
  56.               Quick Reference to Common Menu Commands ......15
  57.               New Object Types .............................17
  58.               New Commands .................................19
  59.               Menu Properties ..............................24
  60.               MenuItem Properties ..........................28
  61.               Menu Colors ..................................35
  62.               Menu Functions ...............................35
  63.               Handling System Menu Items ...................36
  64.               Multiple Separators ..........................36
  65.               doMenu Enhancements ..........................37
  66.               Menus with no visible items ..................38
  67.               Writing a "Window" Menu ......................38
  68.             Faster Language Execution ......................41
  69.             PADtalk Enhancements ...........................42
  70.               New or Enhanced Properties ...................42
  71.               New or Enhanced Messages .....................46
  72.               New or Enhanced Commands .....................47
  73.               New or Enhanced Functions ....................52
  74.               Enhanced Objects .............................56
  75.             Extension Enhancements .........................57
  76.               New Extension Callbacks ......................57
  77.               Sample Extensions ............................63
  78.             Support for TSR Programs .......................67
  79.             International Support ..........................68
  80.             Miscellaneous Enhancements .....................70
  81.        HyperPAD 2.2 Addendum
  82.  
  83.  
  84.             This is a guide to the new features contained in HyperPAD 2.2.
  85.             HyperPAD's major new features are concentrated in the following
  86.             areas:
  87.  
  88.               o Customizable menus
  89.  
  90.               o Windows 3.0 support
  91.  
  92.               o Faster language interpreter
  93.  
  94.  
  95.             Improvements have also been made in the following areas:
  96.  
  97.               o PADtalk - over 40 additions and improvements
  98.  
  99.               o Extensions - new callback functions
  100.  
  101.               o Read-only pads
  102.  
  103.               o TSR programs
  104.  
  105.               o International dates and times
  106.  
  107.               o Running under DesqView
  108.  
  109.               o Command line parameters
  110.  
  111.               o Miscellaneous features and fine tuning
  112.  
  113.  
  114.             Where to go from here
  115.  
  116.             This guide is intended to be used as a supplement to the User's
  117.             Guide and the PADtalk Reference Guide. Some information in this
  118.             guide is highly technical and will only be used by advanced
  119.             users. For first time users it is suggested that you read the
  120.             section that follows called "Getting Started" and any other
  121.             sections which may be of interest, then move on to the User's
  122.             Guide. Advanced users, or users who have upgraded from version
  123.             2.0, should read this entire guide for a complete understanding
  124.             of the new or enhanced features offered by HyperPAD 2.2.
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.                                            HyperPAD 2.2 Addendum   1
  134.        Getting Started
  135.  
  136.        System Requirements
  137.  
  138.             HyperPAD 2.2 will run on all IBM or compatible PCs with  at least
  139.             390K of available memory. The Browser requires 328K of available
  140.             memory. HyperPAD will run with ersion 2.1 or later (including DOS
  141.             5.0).
  142.  
  143.  
  144.             A hard disk is required to install HyperPAD 2.2. Once installed,
  145.             the necessary files can be copied onto floppy disks and run,
  146.             although a hard disk is strongly recommended.
  147.  
  148.  
  149.        Converting Pads to HyperPAD 2.2 File Format
  150.  
  151.             The file format for HyperPAD 2.2 pads is different from that of
  152.             previous version of HyperPAD. Pads in the old format can be
  153.             opened by HyperPAD 2.2 and run as normal. Once a pad has been
  154.             opened and used by HyperPAD 2.2, there is no going back. You can
  155.             use the PADINFO.EXE utility to determine the pad version (pads
  156.             with version 7 are used by HyperPAD 2.2).
  157.  
  158.  
  159.             The new file format is necessary due to the new instructions
  160.             (pcodes) generated by the PADtalk compiler. These new pcodes are
  161.             not understood by previous version of HyperPAD.
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.        2  HyperPAD 2.2 Addendum
  187.        Installation
  188.  
  189.             To install HyperPAD 2.2 onto your hard disk, use the installation
  190.             procedure described on page 11 of the HyperPAD 2.0 User's Guide.
  191.             The only difference between HyperPAD 2.2 and HyperPAD 2.0 is the
  192.             number of disks (6 instead of 4) and the labels that appear on
  193.             the disks. The procedure is outlined here for convenience:
  194.  
  195.  
  196.               1.Insert the disk labeled "Program Disk 1" into the A: drive.
  197.  
  198.  
  199.               2.Make that drive the current drive by typing:
  200.  
  201.  
  202.                  A:
  203.  
  204.  
  205.                 and pressing ENTER.
  206.  
  207.  
  208.               3.Type:
  209.  
  210.  
  211.                  INSTALL
  212.  
  213.  
  214.                 and press ENTER. Follow the instructions that appear on the
  215.                 screen, inserting the appropriate disks when asked.
  216.  
  217.  
  218.             By default, HyperPAD 2.2 will be installed into a directory
  219.             called \HPAD22 on your hard disk. The basic installation requires
  220.             approximately 2.2 MB of disk space. If you choose to install the
  221.             sample extensions, an additional 1.5 MB of disk space is
  222.             required. Thus, for a full installation you need 3.7 MB of free
  223.             disk space.
  224.  
  225.  
  226.             HyperPAD's files are now stored in a compressed format. An
  227.             uncompression program is used during the install process to
  228.             expand the contents of the disks onto your hard disk. After
  229.             copying the files, HyperPAD automatically executes in order to
  230.             complete the installation of the pads. Once you exit HyperPAD,
  231.             the installation files will be erased and the HPAD.INI file will
  232.             be created.
  233.  
  234.  
  235.             HyperPAD can also be installed from a directory, such as a
  236.             directory on a network. To do this, copy all the files from the
  237.             distribution disks into a single directory (on a hard disk or
  238.             network), then run the install program.
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.                                            HyperPAD 2.2 Addendum   3
  248.             The HyperPAD install program sets up directories in the following
  249.             manner:
  250.  
  251.  
  252.              Directory         Contains
  253.  
  254.  
  255.              \HPAD22           HyperPAD files, utilities, and
  256.                                sample pads
  257.  
  258.              \HPAD22\TUTORIAL  HyperPAD tutorial
  259.  
  260.              \HPAD22\EXTERN    Sample extensions (optional)
  261.  
  262.  
  263.             Installing HyperPAD for Microsoft Windows 3.0
  264.  
  265.  
  266.             There is a new PIF file for use when running HyperPAD 2.2 under
  267.             Windows (HPAD.PIF). Further, there is an icon for use under
  268.             Windows called HPAD.ICO. The procedure for adding HyperPAD 2.2 as
  269.             a Windows program item is as follows:
  270.  
  271.  
  272.               1.At the Program Manager, select "New..." from the File menu.
  273.  
  274.  
  275.               2.Press ENTER to select "Program Item".
  276.  
  277.  
  278.               3.Type "HyperPAD 2.2" into the Description field.
  279.  
  280.  
  281.               4.Press TAB and type in the full DOS path of the PIF file,
  282.                 such as C:\HPAD22\HPAD.PIF".
  283.  
  284.  
  285.               5.Choose "Change Icon...".
  286.  
  287.  
  288.               6.Type in the full DOS path of the icon file, such as
  289.                 "C:\HPAD22\HPAD.ICO".
  290.  
  291.  
  292.               7.Select Ok to close the icon selection dialog box.
  293.  
  294.  
  295.               8.Select Ok.
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.        4  HyperPAD 2.2 Addendum
  308.             Installing HyperPAD for DesqView
  309.  
  310.  
  311.             There is a new DVP file for HyperPAD (HP-PIF.DVP). This allows
  312.             automatic installation of HyperPAD under DesqView. The procedure
  313.             for adding HyperPAD to the DesqView menu is as follows:
  314.  
  315.  
  316.               1.At the main DesqView menu, press "O" to select "Open
  317.                 Window".
  318.  
  319.  
  320.               2.Type "AP" to add a program.
  321.  
  322.  
  323.               3.Press "O" to select Other.
  324.  
  325.  
  326.               4.Type in the directory containing the DVP file, such as
  327.                 "C:\HPAD22".
  328.  
  329.  
  330.               5.Use the arrow keys to move the highlight to the HyperPAD 2.2
  331.                 item.
  332.  
  333.  
  334.               6.Press SPACE to select the item.
  335.  
  336.  
  337.               7.Press ENTER to add the program.
  338.  
  339.  
  340.               8.Press ENTER to select Done.
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.                                            HyperPAD 2.2 Addendum   5
  368.        Microsoft Windows Support
  369.  
  370.             HyperPAD now runs within the Windows 3.0 environment as a safe
  371.             DOS application. Previous version of HyperPAD sometimes produced
  372.             weird effects within Windows 3.0, such as excessive degradation
  373.             in speed and even system crashes.
  374.  
  375.  
  376.             Timer Change
  377.  
  378.             In order to become a safe application, HyperPAD 2.2 no longer
  379.             revectors the system timer to perform timing functions (such as
  380.             effect timing, dialing the phone, delays, and music). This method
  381.             of timer usage was a major source of incompatibility in clone
  382.             computers that caused HyperPAD to not work within Windows and
  383.             DesqView. Instead of using the system clock (which HyperPAD would
  384.             speed up to a millisecond rate) or the byte post mechanism
  385.             supported by PS/2 BIOSs, HyperPAD now uses the interrupt 1Ch
  386.             mechanism which is much safer.
  387.  
  388.  
  389.             The old method of timer use, however, is still necessary to
  390.             display effects and play music. For any of these operations,
  391.             HyperPAD switches to the millisecond clock only for the duration
  392.             of the music or the effect. Thus, when running under Windows, the
  393.             play statement won't work and the effects run only at full speed.
  394.  
  395.  
  396.             Automatic Detection
  397.  
  398.             Microsoft Windows is automatically detected using the semi-
  399.             documented oldapp interrupt 2fh function calls. If present,
  400.             HyperPAD makes the appropriate adjustments in the keyboard device
  401.             driver for Windows to function properly. This method of Windows
  402.             detection is only somewhat reliable. In such a case the auto-
  403.             detection doesn't work, there is a new command line parameter
  404.             that does the same thing.
  405.  
  406.  
  407.             The /WINDOWS command line parameter
  408.  
  409.             This command line parameter (abbreviated /WIN) shuts off trapping
  410.             of special keys sequences, some of which are used by Microsoft
  411.             Windows and TSR software.
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.        6  HyperPAD 2.2 Addendum
  423.             The following table describes the conflicting keys and the
  424.             alternate keys to use if running from within Windows.
  425.  
  426.  
  427.              Key          Used to:                Alternative:
  428.  
  429.  
  430.              ALT+ESC      Switch between          CTRL+Tool Letter
  431.                           browser and designer
  432.  
  433.              ALT+SPACE    Toggle menu bar         ALT+W,E
  434.                           on/off
  435.  
  436.              ALT+TAB      Move the cursor         CTRL+TAB (key
  437.                           between object          number 58368
  438.                           corners (using the      when used
  439.                           Selector Tool)          with the
  440.                                                 keyPress
  441.                                                 handler)
  442.  
  443.              ALT+SHIFT    View solid portions     no equivalent
  444.                           of the page
  445.             
  446.              CTRL+ALT     Show all buttons and    no equivalent
  447.                           fields using an
  448.                           outline
  449.  
  450.              SHIFT+SHIFT  View the page without   no equivalent
  451.                           the underlying
  452.                           background
  453.  
  454.  
  455.             Miscellaneous Notes
  456.  
  457.  
  458.               o The fxshow command will only run in Windows full screen
  459.                 mode.
  460.  
  461.  
  462.               o When running HyperPAD within a window, the mouse will be
  463.                 inactive, as is the case with all DOS applications running
  464.                 within a window. The mouse cursor, however, remains on the
  465.                 screen. The following command removes the mouse from the
  466.                 screen:
  467.  
  468.  
  469.                  set the mouse to off;
  470.  
  471.  
  472.                 To restore the cursor, use the following command:
  473.  
  474.  
  475.                  set the mouse to on;
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.                                            HyperPAD 2.2 Addendum   7
  483.        New Command Line Parameters
  484.  
  485.        /NONOTIFY
  486.  
  487.  
  488.             This parameter causes HyperPAD not display a message when you
  489.             open a pad on a removable disk.
  490.  
  491.  
  492.                hpad /nonotify
  493.  
  494.  
  495.        /NORELOADMSG
  496.  
  497.  
  498.             This parameter suppresses the message "Reloading HyperPAD, please
  499.             wait..." when returning from running another program.
  500.  
  501.  
  502.                hpad /noreloadmsg
  503.  
  504.  
  505.        /WINDOWS
  506.  
  507.  
  508.             This parameter forces HyperPAD to believe that Microsoft Windows
  509.             is installed. The adjustments that HyperPAD makes when this
  510.             parameter is given are described in the section titled "Microsoft
  511.             Windows Support".
  512.  
  513.  
  514.                hpad /windows
  515.  
  516.  
  517.        /V
  518.  
  519.  
  520.             This command line parameter causes HyperPAD to use video memory
  521.             for its offscreen drawing, freeing up additional memory for your
  522.             pads.
  523.  
  524.  
  525.             When updating the screen, HyperPAD draws objects and paint to
  526.             memory buffers, then copies this information to the real display.
  527.             HyperPAD requires 3 such buffers at any one time (during certain
  528.             effects, an additional offscreen buffer is required). The memory
  529.             for these buffers is normally allocated from the system heap
  530.             (somewhere below 640K). Using the /V parameter, however, causes
  531.             HyperPAD to use the extra memory on the video card instead. All
  532.             video cards have at least 12K of extra memory.
  533.  
  534.  
  535.             The following table shows the memory savings depending on the
  536.             video mode used:
  537.  
  538.  
  539.  
  540.  
  541.        8  HyperPAD 2.2 Addendum
  542.              Video Mode    Buffer size     Memory savings
  543.  
  544.              80x25         4000 bytes      12,000 bytes
  545.              80x43         6880 bytes      6880 bytes
  546.              80x50         8000 bytes      8000 bytes
  547.  
  548.  
  549.             You should only use this parameter if you have a fast video card
  550.             that doesn't have retrace (video "snow") problems. Using this
  551.             parameter with a CGA card, for example, will slow down screen
  552.             updates dramatically and cause constant annoying "snow". A 16 bit
  553.             VGA, on the other hand, is fast and will function normally.
  554.  
  555.  
  556.        /CARD, /MONITOR
  557.  
  558.  
  559.             Due to the many differences in clone computers (e.g., BIOS bugs),
  560.             HyperPAD's automatic detection of the video card and monitor type
  561.             is not entirely reliable. The /CARD and /MONITOR command line
  562.             parameters allow you to specify the exact video card and monitor
  563.             type installed in your computer -- overriding HyperPAD's
  564.             automatic sensing.
  565.  
  566.  
  567.             An example where the use of these parameters is necessary is in
  568.             PS/2 computers with both an 8514/A and VGA video adapters.
  569.             HyperPAD cannot correctly recognize this configuration, and thus
  570.             uses a weird color set (blue window shadows, etc...).
  571.  
  572.  
  573.             Each switch is followed by a number corresponding to the value of
  574.             that parameter. To set up HyperPAD for a VGA with a color
  575.             display:
  576.  
  577.  
  578.                hpad /card:8 /monitor:8
  579.  
  580.  
  581.             To set up HyperPAD for a monochrome display:
  582.  
  583.  
  584.                hpad /card:0 /monitor:1
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.                                            HyperPAD 2.2 Addendum   9
  600.             The monitor values are described in the following table:
  601.  
  602.  
  603.              Monitor #    Description
  604.  
  605.              1            Monochrome Monitor
  606.              2            Glorified digital TV set
  607.              3            CGA Color Monitor
  608.              4            EGA Enhanced Color Monitor
  609.              5            Extended 400 line CGA monitor (on
  610.                           some laptops)
  611.              6            PGS HIRES Color
  612.              7            VGA Analog Monochrome
  613.              8            VGA Analog Color
  614.  
  615.  
  616.             The card values are described in the following table:
  617.  
  618.  
  619.              Card #       Description
  620.  
  621.              0            Monochrome
  622.              1            CGA
  623.              2            Extended CGA
  624.              3            Extended CGA - Plasma
  625.              4            Hercules Monochrome
  626.              5            EGA
  627.              6            Extended EGA
  628.              7            MCGA
  629.              8            VGA
  630.              9            Extended VGA
  631.              10           Leading Edge internal graphics
  632.                           adapter
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.        10 HyperPAD 2.2 Addendum
  652.        Other command line parameters
  653.  
  654.  
  655.             The following table summarizes all of HyperPAD's command line
  656.             parameters:
  657.  
  658.  
  659.              Parameter    Meaning
  660.  
  661.              NOMSG        Don't read the HPAD.MSG file,
  662.                           saving approximately 4K of memory.
  663.                           Error messages and menu help text
  664.                           will not be displayed.
  665.  
  666.              25           Creates new pads in 80x25 text
  667.                           mode. You can override this in the
  668.                           New... dialog box.
  669.  
  670.              43           Creates new pads in 80x43 text mode
  671.                           (EGA and VGA only). You can
  672.                           override this in the New... dialog
  673.                           box.
  674.  
  675.              50           Creates new pads in 80x50 text mode
  676.                           (VGA only). You can override this
  677.                           in the New... dialog box.
  678.  
  679.  
  680.              NOSNOW       Suppresses video snow checking,
  681.                           causing faster screen updating.
  682.  
  683.              NOMOUSE      Suppresses use of the mouse.
  684.  
  685.              NOIDLE       Disables sending of the idle
  686.                           message. This is handy for
  687.                           debugging pads with problems in
  688.                           their idle handlers.
  689.  
  690.              MONO         Uses a monochrome color set.
  691.  
  692.              LCD          Uses colors appropriate for LCD
  693.                           monitors (such as some laptops).
  694.  
  695.              B&W          Uses a black and white color set.
  696.  
  697.              GREY         Uses grey-scale colors. Use this
  698.                           option on the Compaq SLT. On the
  699.                           EGA and VGA, this actually
  700.                           translated colors to shades of
  701.                           grey.
  702.  
  703.              COLOR        Uses a color set appropriate for
  704.                           color monitors.
  705.  
  706.              NOAUTOSAVE   Disables automatic saving of the
  707.                           pad. This will increase the time
  708.                           required to write the pad when
  709.                           memory fills up.
  710.  
  711.  
  712.                                            HyperPAD 2.2 Addendum   11
  713.              DEBUG        Calls interrupt 3h after loading
  714.                           HyperPAD. This allows a resident
  715.                           debugger to be set up.
  716.  
  717.              NOKB         Same as NO15.
  718.  
  719.              NO15         Disables use of interrupt 15h for
  720.                           HyperPAD's handling of the
  721.                           keyboard. Use this option on clone
  722.                           computers that exhibit weird
  723.                           keyboard behavior.
  724.  
  725.              ENHANCEDKB   Forces HyperPAD to use an enhanced
  726.                           keyboard. Use this option if
  727.                           HyperPAD is not detecting your
  728.                           enhanced keyboard correctly.
  729.  
  730.              V            Causes HyperPAD to use video memory
  731.                           for its offscreen drawing, saving
  732.                           about 12K of memory for 80x25 text
  733.                           modes and 8K for 80x43 or 80x50
  734.                           text modes. Use this option only if
  735.                           you have a fast video card that
  736.                           doesn't have "snow" trouble.
  737.  
  738.              NORTC        Don't use the real time clock for
  739.                           music and effects. This causes
  740.                           HyperPAD to speed up the system
  741.                           clock.
  742.  
  743.              NOEMM        Don't use EMS memory if available.
  744.                           Use this option if you need to
  745.                           reserve EMS memory for TSR
  746.                           programs.
  747.  
  748.              NONOTIFY     Don't display the "Removable
  749.                           disk..." warning on pads that are
  750.                           being run from a removable disk.
  751.  
  752.              WINDOWS      Force HyperPAD into thinking that
  753.                           Microsoft Windows is running
  754.                           (abbreviated WIN).
  755.  
  756.  
  757.        Freeing memory for use by Pads
  758.  
  759.  
  760.             To run HyperPAD with the most memory free for your pads, use the
  761.             following command line parameters:
  762.  
  763.  
  764.                hpad /v /nomsg
  765.  
  766.  
  767.             You can save additional space if EMS memory is installed and
  768.             available.
  769.  
  770.  
  771.  
  772.        12 HyperPAD 2.2 Addendum
  773.        Support for Read-Only Pads
  774.  
  775.  
  776.             When a pad is marked read-only, the pad file is physically opened
  777.             in read-only mode, preventing any pad changes from being saved to
  778.             disk. A new capability in version 2.2 lets you type into fields
  779.             as normal, but when you change the page or go to another page,
  780.             the modified page will revert to its original state.
  781.  
  782.  
  783.             Some other notes concerning read-only pads:
  784.  
  785.  
  786.               o You can now double-click on buttons and fields using the
  787.                 Selector tool. (A bug in earlier versions prevented objects
  788.                 in read-only pads from being double-clicked.)
  789.  
  790.  
  791.               o You can select the Script... button from the Button Info
  792.                 dialog box or the Field Info dialog box without receiving an
  793.                 error. (A bug in earlier versions caused an extra error
  794.                 message to be displayed.)
  795.  
  796.  
  797.               o Read-only devices such as CD-ROM and write-protected disks
  798.                 are automatically detected. A pad opened on disk media of
  799.                 this type will behave as if it has been marked read-only
  800.                 (even if it hasn't).
  801.  
  802.  
  803.               o If a pad is marked read-only, the letter L (meaning
  804.                 "Locked") will appear on the status bar in column 77.
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.                                            HyperPAD 2.2 Addendum   13
  830.        Customizable Menus
  831.  
  832.  
  833.             A major new feature of HyperPAD 2.2 is the ability to create and
  834.             customize the menus. HyperPAD now provides full control over the
  835.             appearance and behavior of the standard menus and full support
  836.             for custom menus. The following list summarizes the new
  837.             capabilities:
  838.  
  839.  
  840.               o Add new menus to the menu bar.
  841.  
  842.               o Delete menus from the menu bar.
  843.  
  844.               o Add or delete menu items from any menu on the menu bar.
  845.  
  846.               o Delete menu items from existing menus, leaving some of the
  847.                 original menu items. The behavior of the original menu items
  848.                 (such as Copy being dimmed when unavailable) can be
  849.                 preserved as well.
  850.  
  851.               o Modify the appearance of a menu item, including dimming,
  852.                 checked, short-cut key, acceleratorKey, and help text.
  853.  
  854.  
  855.        Differences from HyperPAD 2.0
  856.  
  857.  
  858.             Pads created with previous versions of HyperPAD are completely
  859.             backward compatible with HyperPAD 2.2. Thus, doMenu handlers will
  860.             work as expected. However, there are some minor visual
  861.             differences.
  862.  
  863.  
  864.             Because the menus are customizable, the diagrams in the User's
  865.             Guide and the PADtalk Reference Guide that contain pictures of
  866.             pull down menus no longer exactly match HyperPAD. Most notably,
  867.             the names of the accelerator keys in HyperPAD 2.2 are completely
  868.             spelled out (for example, ALT+F5 instead of *F5 and CTRL+F5
  869.             instead of ^F5). Another difference is in the size of the menus -
  870.             - the menus in HyperPAD 2.2 are wider.
  871.  
  872.  
  873.             Cut/Copy/Paste/Delete Modified
  874.  
  875.  
  876.             The Cut, Copy, Paste, and Delete menu items no longer change
  877.             their names according to the currently selected item. For
  878.             example, Cut will no longer change to Cut Text, Cut Button, or
  879.             Cut Field.
  880.  
  881.  
  882.             For compatibility, the longer names are still supported through
  883.             PADtalk. For example, the following commands perform the same
  884.             function:
  885.  
  886.  
  887.        14 HyperPAD 2.2 Addendum
  888.                doMenu "Cut";
  889.                doMenu "Cut Button";
  890.                doMenu "Cut Field";
  891.                doMenu "Cut Text";
  892.                doMenu "Cut Block";
  893.  
  894.  
  895.             Browser Differences
  896.  
  897.  
  898.             The Browser has been significantly enhanced to support
  899.             customizable menus. By default, the Browser has a menu bar with
  900.             menu commands for each of the available functions. This menu bar
  901.             can easily be removed (to simulate previous versions of the
  902.             Browser) or enhanced in the same way as in HyperPAD 2.2.
  903.  
  904.  
  905.        Quick Reference to Common Menu Commands
  906.  
  907.  
  908.             To create a new menu:
  909.  
  910.                create menu "Commands";
  911.                create menu "Disk" after menu "File";
  912.                create menu "Features" before menu 5;
  913.  
  914.             To delete an existing menu:
  915.  
  916.                delete menu 1;
  917.                delete menu "Edit";
  918.  
  919.             To delete all of the menus:
  920.  
  921.                delete menus;
  922.  
  923.             To restore the menus to their HyperPAD default:
  924.  
  925.                restore menus;
  926.  
  927.             To add a menu item to an existing menu:
  928.  
  929.                put "My &Command" after menu "File";
  930.                put "Disk" after menuItem 2 of menu "Edit";
  931.                put "Features" before menuItem "Paint" of menu "Tools";
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.                                            HyperPAD 2.2 Addendum   15
  943.             To check or uncheck a menu item:
  944.  
  945.                set the check of menuItem 1 of menu 1 to false;
  946.                set the check of menuItem "Menu Bar" of menu
  947.                  "Workspace" to true;
  948.  
  949.             To enable or disable a menu item:
  950.  
  951.                set the dimmed of menuItem 1 of menu 1 to true;
  952.                set the dimmed of menuItem 2 of menu
  953.                  "Workspace" to false;
  954.  
  955.             To temporarily hide a menu or menu item:
  956.  
  957.                set the visible of menu "File" to false;
  958.                set the visible of menuItem "Copy" of
  959.                  menu "Edit" to false;
  960.  
  961.             To make a hidden menu or menu item visible:
  962.  
  963.                set the visible of menu "File" to true;
  964.                show menu "File";
  965.                set the visible of menuItem 1 of menu 1 to true;
  966.                show menuItem "Exit" of menu "File";
  967.  
  968.             To change the help text of a particular menu or menu item:
  969.  
  970.                set the helpText of menu "File" to
  971.                  "Perform a file function.";
  972.                put the helpText of menuItem 1 of menu 1 into
  973.                  the message box;
  974.  
  975.             To reference the number of menus or menu items:
  976.  
  977.                put the number of menus into the message box;
  978.                put the number of menuItems of menu
  979.                  "File" into total;
  980.  
  981.             To see the names of all the menus:
  982.  
  983.                put the menus into the message box;
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.        16 HyperPAD 2.2 Addendum
  993.        New Object Types
  994.  
  995.  
  996.             There are two new object types -- menu and menuItem. The menu
  997.             object is used to refer to the name of the menu and the menu
  998.             items within the menu. The menu object consists of many menuItem
  999.             objects.
  1000.  
  1001.  
  1002.             The syntax used to reference these objects is as follows:
  1003.  
  1004.  
  1005.                menuRef -> menu [string | number]
  1006.  
  1007.                menuItemRef -> menuItem [string | number] of
  1008.                  menuRef
  1009.  
  1010.  
  1011.             The following are sample menu and menuItem object references.
  1012.  
  1013.  
  1014.                menu "File"
  1015.  
  1016.                menu 1
  1017.  
  1018.                menuItem "Open..." of menu "File"
  1019.  
  1020.                menuItem 1 of menu 2
  1021.  
  1022.  
  1023.             The value of a menuItem consists of a semi-colon separated list
  1024.             containing the following:
  1025.  
  1026.  
  1027.                <menuName>;<isDimmed>;<isChecked>;<menuMsg>;
  1028.                  <helpText>;<accelKey>;<isVisible>
  1029.  
  1030.  
  1031.             The following are sample menuItem values:
  1032.  
  1033.  
  1034.                "&Open...;FALSE;FALSE;;Open existing pad;F12;TRUE"
  1035.  
  1036.                "Run"
  1037.  
  1038.                "&Run A Program"
  1039.  
  1040.                "Open...";;;;Open an existing pad;;"
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.                                            HyperPAD 2.2 Addendum   17
  1052.             The values of menu items can be used as shown in the following
  1053.             examples:
  1054.  
  1055.  
  1056.                put menuItem 1 of menu 1 into msg;
  1057.  
  1058.                set the delimiter to ";";
  1059.                put true into item 2 of menuItem 1 of menu 1;
  1060.  
  1061.  
  1062.             Empty values in the semi-colon separated list of a menu item are
  1063.             given default values. For example, the statement
  1064.  
  1065.                put "Exit" into menuItem 1 of menu 2;
  1066.  
  1067.             assumes the following defaults:
  1068.  
  1069.              Item           Default Value
  1070.  
  1071.              <isDimmed>     false
  1072.              <isChecked>    false
  1073.              <menuMsg>      empty ("")
  1074.              <helpText>     empty ("")
  1075.              <accelKey>     empty ("")
  1076.              <isVisible>    true
  1077.  
  1078.  
  1079.             The value of a menu object consists of a carriage-return
  1080.             separated list of zero or more menu items (one line for each menu
  1081.             item). The following is an example menu value:
  1082.  
  1083.  
  1084.                Re&cord...;FALSE,FALSE;;Records actions;;TRUE
  1085.                &Run...;FALSE;FALSE;;Executes commands;;FALSE
  1086.                &Edit...;TRUE;FALSE;;Edits a macro;ALT+E;TRUE
  1087.  
  1088.  
  1089.             Both menu and menuItem objects can be used as both source and
  1090.             destination references. For example:
  1091.  
  1092.  
  1093.                put "Disk" into menuItem 4 of menu "File";
  1094.  
  1095.                put "Beep;FALSE;FALSE;;Make a noise;ALT+B;TRUE" into
  1096.                  menu 3;
  1097.  
  1098.                set the delimiter to ";"
  1099.                if item 2 of menuItem 5 of menu "Edit" then
  1100.                  answer "Paste is disabled!";
  1101.  
  1102.  
  1103.             Numbering of Menu and MeneItem objects
  1104.  
  1105.  
  1106.             As described above, Menu and MenuItem objects can be referenced
  1107.             by number. Menus are numbered from 1 to the number of menus,
  1108.  
  1109.  
  1110.        18 HyperPAD 2.2 Addendum
  1111.             starting on the left side of the menu bar. For example, the File
  1112.             menu is menu 1.
  1113.  
  1114.  
  1115.             If the File menu is not visible (i.e., the visible property is
  1116.             set to false), it is still referenced as menu number 1, even
  1117.             though Edit appears as the first menu on the menu bar.
  1118.  
  1119.  
  1120.             As another example, while using the Browse tool, the Block menu
  1121.             is not visible. This menu, however, can be referenced as menu
  1122.             number 8.
  1123.  
  1124.             The same is true for menuItem objects.
  1125.  
  1126.  
  1127.             Error messages
  1128.  
  1129.  
  1130.             Reference to a non-existent menu produces error 60, "Can't find
  1131.             menu." For example, you will receive this error message with the
  1132.             following command:
  1133.  
  1134.                put menu 66 into page field 1;
  1135.  
  1136.             Reference to a non-existent menu item produces error 61, "Can't
  1137.             find menu item.". For example, you will receive this error
  1138.             message with the following command:
  1139.  
  1140.                put menuItem 200 of menu 1 into the message box;
  1141.  
  1142.        New Commands
  1143.  
  1144.             The following commands have been added to facilitate creating and
  1145.             deleting menus and menu items:
  1146.  
  1147.  
  1148.              Command        Description
  1149.  
  1150.              create         Create a new menu
  1151.  
  1152.              delete         Delete a menu, a menu item, or
  1153.                             all the menus
  1154.  
  1155.              restore        Restore a menu to the its
  1156.                             default, or restores all menus
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.                                            HyperPAD 2.2 Addendum   19
  1168.        create
  1169.  
  1170.  
  1171.             Syntax:
  1172.  
  1173.                create menu <menuName> [[before | after] <menuRef>;
  1174.  
  1175.  
  1176.             Purpose: This command creates a new menu after the last menu on
  1177.             the menu bar. Optionally, a menu can be created before or after
  1178.             any existing menu on the menu bar.
  1179.  
  1180.  
  1181.             Menus cannot be created which cause the total length of the menu
  1182.             bar to exceed the width of the screen (normally 80 characters).
  1183.  
  1184.  
  1185.             This command does not create menu items -- only a place holder on
  1186.             the menu bar with a name. Use the put command to add menu items
  1187.             to a menu after creating it.
  1188.  
  1189.  
  1190.             Examples:
  1191.  
  1192.  
  1193.                create menu "Commands";
  1194.  
  1195.  
  1196.                create menu "Commands" after menu "File";
  1197.  
  1198.  
  1199.                create menu "Commands" before menu 4;
  1200.  
  1201.  
  1202.             The following example moves the File menu to the end of the menu
  1203.             bar:
  1204.  
  1205.  
  1206.                put menu "File" into saved;
  1207.                delete menu "File";
  1208.                create menu "File";
  1209.                put saved into menu "File";
  1210.  
  1211.  
  1212.             The next example creates a complete menu:
  1213.  
  1214.  
  1215.                create menu "Help";
  1216.                put "&Index;FALSE;FALSE;;Index of help topics;;FALSE" into
  1217.                  menu "Help";
  1218.                put "&Keyboard;FALSE;FALSE;;Help on keyboard;;FALSE" after
  1219.                  menu "Help";
  1220.                put "-" after menu "Help";
  1221.                put "About" after menu "Help";
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.  
  1228.        20 HyperPAD 2.2 Addendum
  1229.        delete
  1230.  
  1231.  
  1232.             Syntax
  1233.  
  1234.  
  1235.                delete menus;
  1236.  
  1237.                delete <menuItemRef>;
  1238.  
  1239.                delete <menuRef>;
  1240.  
  1241.  
  1242.             Purpose: This command deletes a menu, menu item, or all the
  1243.             menus, depending on the usage.
  1244.  
  1245.  
  1246.             After deleting a menu or menu item, the associated accelerator
  1247.             key will not work (such as PGUP, PGDN, ALT+F5, or F12). For
  1248.             example, deleting the Next command from the Go menu will also
  1249.             make PGDN inoperative. Note, however, that even though a standard
  1250.             menu command (such as those that appear on HyperPAD's default
  1251.             menus) is deleted, the doMenu message will still work from a
  1252.             script. For example, if the Next command is deleted from the Go
  1253.             menu, a script containing:
  1254.  
  1255.  
  1256.                doMenu "Next";
  1257.  
  1258.  
  1259.             will still go to the next page.
  1260.  
  1261.  
  1262.             The syntax delete menus deletes all of the menus on the menu bar.
  1263.             Deleting all of the menus removes the menu bar, leaving only the
  1264.             status bar (if it's currently visible). Thus, the menu bar will
  1265.             only be displayed if there is at least one menu visible and the
  1266.             menu bar is currently on.
  1267.  
  1268.  
  1269.             Deleting a menu or menu item actually removes that menu or menu
  1270.             item from the menu bar. If you need to remove a menu or menu item
  1271.             temporarily, you can hide it by setting the visible property.
  1272.  
  1273.  
  1274.             Deleted menus and menu items of the standard HyperPAD menus can
  1275.             be recovered using the restore command.
  1276.  
  1277.  
  1278.             The Delete command behaves differently with menus and menu items
  1279.             than it does with containers (such as variables or fields). With
  1280.             containers, the delete command is equivalent to putting empty
  1281.             into the container. For example, the following two statements are
  1282.             equivalent:
  1283.  
  1284.  
  1285.                put empty into page field 1;
  1286.                delete page field 1;
  1287.  
  1288.  
  1289.                                            HyperPAD 2.2 Addendum   21
  1290.             When deleting menus and menu items, the delete command actually
  1291.             removes the specified menu or menu item. If you want to create an
  1292.             empty menu or menu item, you must use the put command. For
  1293.             example, the following statement removes the File menu from the
  1294.             menu bar:
  1295.  
  1296.                delete menu "File"; -- remove the File menu
  1297.  
  1298.  
  1299.             The following command removes all of the menu items from the File
  1300.             menu:
  1301.  
  1302.                put empty into menu "File";  -- create an empty File menu
  1303.  
  1304.  
  1305.             The following command removes the first menu item from the File
  1306.             menu:
  1307.  
  1308.                -- remove the New command
  1309.                delete menuItem 1 from menu "File";
  1310.  
  1311.             The following command creates an empty menu item:
  1312.  
  1313.                -- create empty item
  1314.                put empty into menuItem 1 of menu "File";
  1315.  
  1316.             Examples:
  1317.  
  1318.  
  1319.                delete menus;   -- delete all of the menus
  1320.  
  1321.                delete menu "File";    -- remove the File menu
  1322.  
  1323.                -- remove the Open... command
  1324.                delete menuItem 1 of menu "File";
  1325.  
  1326.                delete the last menuItem of menu "Edit";
  1327.  
  1328.                delete the first menuItem of the last menu;
  1329.  
  1330.  
  1331.             The following example removes a menu, then restores it:
  1332.  
  1333.  
  1334.                delete menu "Go";
  1335.                   :
  1336.                   :
  1337.                restore menu "Go";
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.        22 HyperPAD 2.2 Addendum
  1347.        restore
  1348.  
  1349.  
  1350.             Syntax
  1351.  
  1352.                restore menus;
  1353.  
  1354.                restore <menuRef>;
  1355.  
  1356.  
  1357.             Purpose: The restore command is used to return a standard menu to
  1358.             its original state. The restore command can also be used to
  1359.             restore the menu bar to its default state, deleting all of the
  1360.             non-standard menus.
  1361.  
  1362.  
  1363.             The following menus can be restored individually:
  1364.  
  1365.  
  1366.                File        Edit      Database  Go
  1367.                Tools       Objects   Workspace Block
  1368.  
  1369.  
  1370.             In the Browser, the following menus can be restored:
  1371.  
  1372.  
  1373.                File        Edit      Go        Workspace
  1374.  
  1375.  
  1376.             The restore command is particularly useful for resetting the
  1377.             menus in order to edit a pad. For example, if the Tools menu has
  1378.             been deleted, you will be unable to switch tools. The following
  1379.             steps will restore the menus under such a circumstance:
  1380.  
  1381.  
  1382.               1.Press ALT+F4 to place the cursor into the message box
  1383.  
  1384.               2.Type restore menus and press ENTER
  1385.  
  1386.  
  1387.             Examples:
  1388.  
  1389.  
  1390.                restore menus; -- revert all menus to default state
  1391.  
  1392.  
  1393.                -- restore the File menu to original state
  1394.                restore menu "File";
  1395.  
  1396.  
  1397.                restore menu 2;  -- restores the menu at position 2
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.                                            HyperPAD 2.2 Addendum   23
  1407.             The following handlers modify the menu bar on entry to a pad,
  1408.             then restore it upon exiting. The handlers belong in a pad
  1409.             script.
  1410.  
  1411.  
  1412.                handler openPad;
  1413.                begin
  1414.                  delete menus;          -- delete all of the menus
  1415.                  create menu "Commands";
  1416.                  put "Exit" into menu "Commands";
  1417.                  set the acceleratorKey of menu "Exit" to "ALT+X";
  1418.                end;
  1419.  
  1420.  
  1421.                handler closePad;
  1422.                begin
  1423.                  restore menus;
  1424.                end;
  1425.  
  1426.  
  1427.        Menu Properties
  1428.  
  1429.             The following list summarizes the properties of menu objects:
  1430.  
  1431.  
  1432.              Property  Value         Description
  1433.  
  1434.              name      string        Name of the menu, such
  1435.                                      as "File", that appears
  1436.                                      on the menu bar
  1437.  
  1438.              visible   true or       true if the menu is
  1439.                        false         visible, false otherwise
  1440.  
  1441.              helpText  string        Text that appears on the
  1442.                                      bottom line of the
  1443.                                      screen when the menu
  1444.                                      name is highlighted and
  1445.                                      before the menu has been
  1446.                                      pulled down
  1447.  
  1448.              dimmed    true or       Set to true to disable
  1449.                        false         all menu items, or false
  1450.                                      otherwise
  1451.  
  1452.  
  1453.        dimmed
  1454.  
  1455.  
  1456.             Purpose: The dimmed property is used to enable or disable all of
  1457.             the menu items of a particular menu. This property can only be
  1458.             set. The possible values are true and false.
  1459.  
  1460.  
  1461.             Be careful setting this property because of the double negatives.
  1462.             The following two statements help in determining which value to
  1463.             use:
  1464.  
  1465.  
  1466.        24 HyperPAD 2.2 Addendum
  1467.               o Setting the dimmed to true disables all of the menu items.
  1468.  
  1469.               o Setting the dimmed to false enables all of the menu items.
  1470.  
  1471.  
  1472.             Examples:
  1473.  
  1474.  
  1475.                set the dimmed of menu "File" to true;
  1476.  
  1477.                set the dimmed of menu "Edit" to false;
  1478.  
  1479.  
  1480.             The following lines enable only the New... command on the File
  1481.             menu:
  1482.  
  1483.  
  1484.                set the dimmed of menu "File" to true;
  1485.                set the dimmed of menuItem "New..." of
  1486.                  menu "File" to false;
  1487.  
  1488.  
  1489.        name
  1490.  
  1491.  
  1492.             Purpose: This property is used to get or set the name of a menu.
  1493.             Note that once the name of the menu has changed, the previous
  1494.             name can no longer be used as a reference to that menu.
  1495.  
  1496.  
  1497.             The first letter of the name of the menu is used as the
  1498.             accelerator key for that menu. For example, ALT+F is used as the
  1499.             accelerator key for the File menu. Always make sure that your
  1500.             menu names start with a unique letter, or you will have two menus
  1501.             with the same accelerator key.
  1502.  
  1503.  
  1504.             Any text can be used in the name of a menu. However, do not use
  1505.             carriage-returns, spaces, and other non-meaningful characters.
  1506.             Menu names with spaces may appear as two separate menus and
  1507.             confuse the user. Menu names can be any length as long as it fits
  1508.             on the menu bar.
  1509.  
  1510.  
  1511.             Examples:
  1512.  
  1513.  
  1514.                set the name of menu "File" to "Commands";
  1515.  
  1516.                set the name of menu 1 to "Disk";
  1517.  
  1518.                put the name of menu 3 into the message box;
  1519.  
  1520.                if the name of menu "1" is not "File" then
  1521.                  answer "The menus have been modified." with "Ok";
  1522.  
  1523.  
  1524.  
  1525.  
  1526.                                            HyperPAD 2.2 Addendum   25
  1527.        visible
  1528.  
  1529.  
  1530.             Purpose: This property allows you to hide or show a menu. This is
  1531.             particularly useful if you need to hide a menu temporarily while
  1532.             the user is in a particular mode, then make the menu available
  1533.             later. The possible values are true and false.
  1534.  
  1535.  
  1536.             For example, suppose that you want a "Font" menu visible only
  1537.             when the user is within a particular field. You could show the
  1538.             menu (setting the visible to true) in the openField handler and
  1539.             hide the field in the closeField handler. The following two
  1540.             handlers within the script of a field will accomplish this task:
  1541.  
  1542.  
  1543.                handler openField;
  1544.                begin
  1545.                  set the visible of menu "Font" to true;
  1546.                end;
  1547.  
  1548.  
  1549.                handler closeField;
  1550.                begin
  1551.                  set the visible of menu "Font" to false;
  1552.                end;
  1553.  
  1554.  
  1555.             The visible property can be modified using the hide and show
  1556.             commands.
  1557.  
  1558.  
  1559.             Examples:
  1560.  
  1561.  
  1562.                if the visible of menu "Block" then
  1563.                  answer "Using a paint tool.";
  1564.  
  1565.  
  1566.                -- hide the File menu
  1567.                set the visible of menu "File" to false;
  1568.  
  1569.  
  1570.                -- hide all the menus
  1571.                for i = the number of menus down to 1 do hide menu i;
  1572.  
  1573.  
  1574.                -- show the block menu (if it is hidden)
  1575.                show menu "Block";
  1576.  
  1577.  
  1578.             Note: Modifying the visible property of a menu of menu item does
  1579.             not change its numbering. For example, if the file menu is not
  1580.             visible, it is still referenced as menu number 1.
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.        26 HyperPAD 2.2 Addendum
  1588.        helpText
  1589.  
  1590.  
  1591.             Purpose: This property defines the text that appears on the
  1592.             status bar when the menu name is highlighted and the menu hasn't
  1593.             been pulled down. The maximum length is one character less than
  1594.             the width of the screen (normally 79 characters).
  1595.  
  1596.  
  1597.             Examples:
  1598.  
  1599.  
  1600.                set the helpText of menu "File" to
  1601.                  "These are file commands.";
  1602.  
  1603.  
  1604.                put the helpText of menu 2 into page field 1;
  1605.  
  1606.  
  1607.                -- gather all of the help messages into a field:
  1608.                put empty into page field 1;
  1609.                for i = 1 to the number of menus do
  1610.                  put the helpText of menu i after
  1611.                    the last line of page field 1;
  1612.  
  1613.  
  1614.                -- to save memory, get rid of the help text...
  1615.                for i = 1 to the number of menus do
  1616.                  set the helpText of menu i to empty;
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.                                            HyperPAD 2.2 Addendum   27
  1644.        MenuItem Properties
  1645.  
  1646.  
  1647.             The menuItem object has the following properties:
  1648.  
  1649.              Property       Value         Description
  1650.  
  1651.  
  1652.              dimmed         true or       true  if the menu
  1653.                             false         item is not
  1654.                                           selectable, false
  1655.                                           otherwise
  1656.  
  1657.              checked        true or       true if there is a
  1658.                             false         check mark next to
  1659.                                           the menu item,
  1660.                                           false otherwise
  1661.  
  1662.              menuMsg        string        Message to be sent
  1663.                                           when the menu item
  1664.                                           is selected
  1665.  
  1666.              acceleratorKey string        Text that appears
  1667.                                           right justified in
  1668.                                           the menu
  1669.  
  1670.              helpText       string        Text that appears
  1671.                                           on the status bar.
  1672.  
  1673.              name           string        Name of the menu
  1674.                                           item, such as
  1675.                                           "Open...".
  1676.  
  1677.              visible        true or       true if the menu
  1678.                             false         item is visible on
  1679.                                           the menu, false
  1680.                                           otherwise
  1681.  
  1682.  
  1683.             The maximum allowable menu items in a menu is determined by the
  1684.             following formula:
  1685.  
  1686.                screenHeight() - 3
  1687.  
  1688.  
  1689.        dimmed
  1690.  
  1691.  
  1692.             Purpose: This property is used to enable or disable a menu item.
  1693.             When true, the menu item is disabled. When false, the menu item
  1694.             is enabled.
  1695.  
  1696.  
  1697.             Setting the dimmed property of menu items is particularly useful
  1698.             for enabling choices depending on a mode that the user is in. For
  1699.             example, the Copy, Cut, and Delete choices are dimmed by HyperPAD
  1700.             when there is no selection.
  1701.  
  1702.  
  1703.  
  1704.        28 HyperPAD 2.2 Addendum
  1705.             Disabled menu items cannot be selected. Further, the accelerator
  1706.             keys associated with a dimmed menu item will do nothing.
  1707.  
  1708.  
  1709.             HyperPAD disables and enables many standard menu items
  1710.             automatically, such as Cut, Copy, and Delete. Thus, if you modify
  1711.             the dimmed property of these menu items, they may not stay that
  1712.             way. (See the menuMsg property for more information.)
  1713.  
  1714.  
  1715.             Examples:
  1716.  
  1717.  
  1718.                set the dimmed of menuItem 1 of menu "Workspace" to false;
  1719.  
  1720.  
  1721.                -- don't allow new pads...
  1722.                set the dimmed of menuItem 1 of menu "File" to true;
  1723.  
  1724.  
  1725.             The following two handlers in the script of a listbox field
  1726.             enable a menu item only if the user has marked some lines:
  1727.  
  1728.  
  1729.                handler mark;
  1730.                begin
  1731.                  get the markedLines of me is empty;
  1732.                  set the dimmed of menuItem 3 of menu 4 to it;
  1733.                  pass;
  1734.                end;
  1735.  
  1736.  
  1737.                handler unMark;
  1738.                begin
  1739.                  get the markedLines of me is empty;
  1740.                  set the dimmed of menuItem 3 of menu 4 to it;
  1741.                  pass;
  1742.                end;
  1743.  
  1744.  
  1745.        checked
  1746.  
  1747.  
  1748.             Purpose: This property is used to place or remove a checkmark
  1749.             from a menu item. If true, a check mark (ASCII 251) is displayed
  1750.             to the left of the menu item. If false, there is no check mark.
  1751.  
  1752.  
  1753.             Menus that contain menu items with check marks are one character
  1754.             wider than normal menus.
  1755.  
  1756.  
  1757.             The check mark is useful as an indication that something in your
  1758.             pad is ON, enabled, or true. For example, the Message Box menu
  1759.             item in the Workspace menu is checked when the message box is
  1760.             currently open.
  1761.  
  1762.  
  1763.  
  1764.  
  1765.                                            HyperPAD 2.2 Addendum   29
  1766.             Examples:
  1767.  
  1768.  
  1769.                set the checked of menuItem 1 of menu "File" to true;
  1770.  
  1771.  
  1772.                -- adjust the visibility of field depending on the state:
  1773.                set the visible of page field "Country" to
  1774.                  the check of menuItem "International" of menu "MyMenu";
  1775.  
  1776.  
  1777.                set the checked of the last menuItem of
  1778.                  the last menu to false;
  1779.  
  1780.  
  1781.        menuMsg
  1782.  
  1783.  
  1784.             Purpose: The menuMsg property is used to send a message other
  1785.             than doMenu when a menu item is selected. You can use any one
  1786.             word identifier up to 32 characters in length -- i.e., any valid
  1787.             handler name.
  1788.  
  1789.  
  1790.             If the menuMsg property is empty, selecting a menu item will send
  1791.             a doMenu message. All standard menu items are sent as doMenu
  1792.             messages, the handlers for which are contained in HyperPAD
  1793.             itself. This allows you to intercept any menu command by simply
  1794.             defining a doMenu handler somewhere in the message path and
  1795.             passing only selected menu commands through to HyperPAD.
  1796.  
  1797.  
  1798.             If the menuMsg property is not empty, its value is sent as a
  1799.             message in place of the normal doMenu message. This allows you to
  1800.             define handlers for your own messages without having to intercept
  1801.             doMenu. The parameters sent along with this message are the menu
  1802.             item name, the menu name, and the menu item number. The following
  1803.             example shows how to declare such a handler:
  1804.  
  1805.  
  1806.                handler myMenus(ItemName,menuName,itemNumber);
  1807.                begin
  1808.                end;
  1809.  
  1810.  
  1811.             Setting the menuMsg property of a standard menu item has a
  1812.             special purpose in HyperPAD. Normally, standard menu items such
  1813.             as Cut, Copy, and Delete are dimmed automatically by HyperPAD
  1814.             depending on what is selected. If you want to redefine these menu
  1815.             commands for use in your own pads, this behavior is inacceptable
  1816.             (HyperPAD will override any dimming that you perform on these
  1817.             choices). To resolve this conflict, you can define the menuMsg of
  1818.             these items, causing HyperPAD to treat these menu items as user-
  1819.             defined rather than as standard.
  1820.  
  1821.  
  1822.  
  1823.  
  1824.        30 HyperPAD 2.2 Addendum
  1825.             The following example changes these three menu items so that they
  1826.             can be used within a pad:
  1827.  
  1828.  
  1829.                set the menuMsg of menuItem "Copy" of
  1830.                  menu "Edit" to "myEdit";
  1831.                set the menuMsg of menuItem "Cut" of
  1832.                  menu "Edit" to "myEdit";
  1833.                set the menuMsg of menuItem "Delete" of
  1834.                  menu "Edit" to "myEdit";
  1835.  
  1836.  
  1837.             The following handler can now be used to define behavior for
  1838.             these menu items when they are selected. It operates on the
  1839.             contents of page field 1 and uses a global variable called
  1840.             "clipboard" in which to save the contents.
  1841.  
  1842.  
  1843.                handler myEdit(itemName,menuName,itemNumber,menuNum);
  1844.                begin
  1845.                  global clipboard;
  1846.  
  1847.  
  1848.                  if itemName is "Copy" or itemName is "Cut" then
  1849.                    put page field 1 into clipboard;
  1850.                  if itemName is "Cut" or itemName is "Delete" then
  1851.                    delete page field 1;
  1852.                end;
  1853.  
  1854.  
  1855.             Examples:
  1856.  
  1857.  
  1858.                -- redefine the message sent by Cut:
  1859.                set the menuMsg of menuItem "Cut" of
  1860.                  menu "Edit" to "myEdit";
  1861.  
  1862.  
  1863.                -- set the behavior of Cut back to normal:
  1864.                set the menuMsg of menuItem "Cut" of
  1865.                  menu "Edit" to "myEdit";
  1866.  
  1867.  
  1868.        acceleratorKey
  1869.  
  1870.  
  1871.             Purpose: This property allows you to define an accelerator key
  1872.             for any menu item. The accelerator key name will appear right
  1873.             justified within the menu. Any text up to 32 characters can be
  1874.             used as the accelerator key.
  1875.  
  1876.  
  1877.             If the specified accelerator key name represents a valid key
  1878.             name, then that key will be used within HyperPAD to activate that
  1879.             menu item. Appendix 2 in the PADtalk Reference Guide lists all
  1880.             available key names.
  1881.  
  1882.  
  1883.                                            HyperPAD 2.2 Addendum   31
  1884.             If the specified name is not a valid key name, the text will
  1885.             still appear in the menu.
  1886.  
  1887.  
  1888.             The key name is displayed right justified in the menu next to its
  1889.             corresponding menu item. When a menu is displayed, the width is
  1890.             determined by adding the width of the longest visible item name
  1891.             to the length of the longest accelerator key name plus 2 (plus 1
  1892.             if any menu item is checked).
  1893.  
  1894.  
  1895.             Assigning an accelerator key redefines that key for all of
  1896.             HyperPAD. Pressing that key will send the menuMsg, if defined, or
  1897.             doMenu otherwise.
  1898.  
  1899.  
  1900.             Examples:
  1901.  
  1902.                set the acceleratorKey of menuItem 1 of
  1903.                  menu 1 to "ALT+1";
  1904.  
  1905.  
  1906.                set the accelKey of menuItem "Message Box" of menu
  1907.                  "Workspace" to "ALT+M";
  1908.  
  1909.  
  1910.                -- get rid of all accelerators:
  1911.                for i = 1 to the number of menus do
  1912.                  begin
  1913.                    for j=1 to the number of menuItems of menu i do
  1914.                      set the accelKey of menuItem j of
  1915.                        menu i to empty;
  1916.                  end;
  1917.  
  1918.  
  1919.             Note: This property can be abbreviated accelKey.
  1920.  
  1921.  
  1922.        helpText
  1923.  
  1924.  
  1925.             Purpose: This property sets or gets the help text that appears on
  1926.             the status bar when the menu item is highlighted. Any text can be
  1927.             used, as long as the width is less than or equal to the screen
  1928.             width - 1 (normally 79 characters).
  1929.  
  1930.  
  1931.             Examples:
  1932.  
  1933.  
  1934.                set the helpText of menuItem 1 of menu "File" to
  1935.                  "Create a new pad.";
  1936.  
  1937.  
  1938.                put the helpText of menuItem 3 of menu "Edit" into
  1939.                  page field 1;
  1940.  
  1941.  
  1942.  
  1943.  
  1944.        32 HyperPAD 2.2 Addendum
  1945.        name
  1946.  
  1947.  
  1948.             Purpose: This property gets or sets the name of a menu item. Any
  1949.             text can be used, including spaces, up to 40 characters in
  1950.             length. An ampersand (&) appearing before any characters makes
  1951.             that character the accelerator key for that menu item (such as
  1952.             'x' in "E&xit"). The hyphen is used to make a separator bar (-).
  1953.  
  1954.  
  1955.             Examples:
  1956.  
  1957.  
  1958.                set the name of menuItem 1 of menu "File" to "&New...";
  1959.  
  1960.                set the name of menuItem 2 of menu "File" to "-";
  1961.  
  1962.                if the name of menuItem 3 of menu "Edit" is "Cut" then
  1963.                  answer "Hello World" with "Ok";
  1964.  
  1965.  
  1966.             The following example collects the menu item names into a popup
  1967.             menu:
  1968.  
  1969.  
  1970.                put the number of menuItems of menu "File" into numItems;
  1971.                put empty into list;
  1972.                for i = 1 to numItems do
  1973.                  put the name of menuItem i of menu "File" after
  1974.                    the last line of list;
  1975.                get popup(10,10,list);
  1976.  
  1977.  
  1978.        visible
  1979.  
  1980.  
  1981.             Purpose: This property hides or shows a menu item. The possible
  1982.             values are true and false.
  1983.  
  1984.  
  1985.             Hiding and showing menu items can be used to:
  1986.  
  1987.  
  1988.               o Implement long and short menus (hiding menu items in the
  1989.                 short mode)
  1990.  
  1991.               o Remove menu items temporarily while a mode is set
  1992.  
  1993.               o Showing special menu items based on the user's privilege
  1994.                 level
  1995.  
  1996.               o Disabling certain standard menu items to mask out
  1997.                 capabilities for non-technical users.
  1998.  
  1999.  
  2000.  
  2001.  
  2002.                                            HyperPAD 2.2 Addendum   33
  2003.             Hiding menu items is different than deleting in that the menu
  2004.             item can be unhidden at a later time in a single command. This is
  2005.             much faster than creating the menu item from scratch. HyperPAD
  2006.             itself uses hidden menu items to implement user levels. This
  2007.             capability is also used to hide and show tool specific menus
  2008.             (witness the Block menu which is only visible if using a paint
  2009.             tool).
  2010.  
  2011.  
  2012.             This property can also be modified using the hide and show
  2013.             commands.
  2014.  
  2015.  
  2016.             When modifying the visibility of menu items, it is possible to
  2017.             inadvertently create a strange looking menu, such as one that has
  2018.             two separator bars next to each other. HyperPAD relieves you from
  2019.             this complication by following these rules when displaying a
  2020.             menu:
  2021.  
  2022.  
  2023.               o Two separator bars in a row are collapsed into a single bar
  2024.  
  2025.               o A separator bar as the first visible menu item will not be
  2026.                 displayed
  2027.  
  2028.               o A separator bar as the last visible menu item will not be
  2029.                 displayed
  2030.  
  2031.               o Menus with no visible menu items will not pull down
  2032.  
  2033.               o Menus with only separator bars visible will not pull down
  2034.  
  2035.  
  2036.             The visibility of standard menu items is controlled by HyperPAD.
  2037.             For example, if you make the Paint Attr... menu item visible on
  2038.             the Workspace menu, HyperPAD will eventually correct this for
  2039.             you. Thus, you cannot count on standard menu items staying the
  2040.             way you like them (unless you change the menuMsg for that menu
  2041.             item).
  2042.  
  2043.  
  2044.             Examples:
  2045.  
  2046.  
  2047.                set the visible of menuItem 1 of menu 1 to false;
  2048.  
  2049.                hide menuItem 1 of menu 1;
  2050.  
  2051.                show menuItem 1 of menu "Workspace";
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  
  2060.        34 HyperPAD 2.2 Addendum
  2061.        Menu Colors
  2062.  
  2063.  
  2064.             The colors of the menus are controlled with the menuColors
  2065.             property. This property returns a comma separated list of colors
  2066.             in the following format:
  2067.  
  2068.                <menu>,<dimmed>,<letter>,<hilite>
  2069.  
  2070.             The following table describes the colors values:
  2071.  
  2072.  
  2073.              Variable  Description         Default Value
  2074.  
  2075.  
  2076.              <menu>    normal menu text.   black on grey
  2077.                                            (112)
  2078.  
  2079.              <dimmed>  dimmed menu items.  dark grey on grey
  2080.                                            (120)
  2081.  
  2082.              <letter>  short cut keys.     red on grey (116)
  2083.  
  2084.              <hilite>  highlighted menu    grey on black (7)
  2085.                        item and menu
  2086.                        title.
  2087.  
  2088.  
  2089.             The following examples show how to change colors:
  2090.  
  2091.                -- default colors
  2092.                set the menuColors to 112,120,116,7;
  2093.  
  2094.                set the menuColors to green,grey,red,black on grey;
  2095.  
  2096.                put the menuColors into savedMenuColors;
  2097.  
  2098.             Note: Changing the menu colors also changes the color of the
  2099.             message box and the tool box.
  2100.  
  2101.  
  2102.        Menu Functions
  2103.  
  2104.  
  2105.             The following functions allow access to the number of menus and
  2106.             the number of menu items contained within a particular menu:
  2107.  
  2108.                the number of menus
  2109.  
  2110.                the number of menuItems of <menuRef>
  2111.  
  2112.  
  2113.             The menus() function returns a comma-separated list of the menu
  2114.             names.
  2115.  
  2116.                put the menus;
  2117.  
  2118.                if "File" is in the menus then doMenu "Open...";
  2119.  
  2120.  
  2121.                                            HyperPAD 2.2 Addendum   35
  2122.             The function may return a value such as:
  2123.  
  2124.                "File,Edit,Database,Go"
  2125.  
  2126.  
  2127.        Handling System Menu Items
  2128.  
  2129.  
  2130.             A system menu item is a standard menu item that HyperPAD dims,
  2131.             checks, and makes visible automatically. These menu items, when
  2132.             selected, generate a doMenu message with the menu item name as a
  2133.             parameter. If you set the menuMsg property for these menu items,
  2134.             HyperPAD will assume that you have redefined that menu item for
  2135.             your own application.
  2136.  
  2137.  
  2138.             For example, the following will redefine the New Page command on
  2139.             the Edit menu:
  2140.  
  2141.  
  2142.                set the menuMsg of menuItem "New Page" of menu
  2143.                  "Edit" to "NewPageMsg";
  2144.  
  2145.  
  2146.             If the value of the menuMsg property is empty, then HyperPAD will
  2147.             assume this is a system menu item.
  2148.  
  2149.  
  2150.             Note: A menu item is treated as a system menu item if the name of
  2151.             the menu item is the same as a standard menu item and there is no
  2152.             menuMsg defined for that menu item.
  2153.  
  2154.  
  2155.        Multiple Separators
  2156.  
  2157.  
  2158.             Invalid separator bars are ignored when drawing the menu. The
  2159.             following are invalid separator bars:
  2160.  
  2161.  
  2162.               o A separator bar as the first visible menu item in a menu
  2163.  
  2164.               o A separator bar as the last visible menu item in a menu
  2165.  
  2166.               o Two visible separator bars next to each other
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.        36 HyperPAD 2.2 Addendum
  2182.        doMenu Enhancements
  2183.  
  2184.  
  2185.             The doMenu message now has additional parameters specifying the
  2186.             menu that initiated the message, the menu item number, and the
  2187.             menu number. The following declaration shows these parameters and
  2188.             the order in which they need to be declared:
  2189.  
  2190.  
  2191.                handler doMenu(itemName,menuName,itemNum,menuNum);
  2192.                begin
  2193.                end;
  2194.  
  2195.  
  2196.             Any doMenu handlers written for HyperPAD previous to version 2.2
  2197.             will still work as normal. To make use of the new menu
  2198.             customization features, however, you will need access to the
  2199.             additional parameters passed with the doMenu message.
  2200.  
  2201.  
  2202.             For example:
  2203.  
  2204.  
  2205.                handler doMenu(itemName,menuName,itemNum,menuNum);
  2206.                begin
  2207.                  if itemName is "Copy" then
  2208.                    begin
  2209.                      if menuName is "Edit" then
  2210.                        answer "You picked standard Copy command"
  2211.                      else
  2212.                        answer "You picked Copy from the" &&
  2213.                          menuName && menu.";
  2214.                    end
  2215.                  else pass;
  2216.                end;
  2217.  
  2218.  
  2219.             The arguments to doMenu are described as follows:
  2220.  
  2221.  
  2222.              Argument to doMenu   Description
  2223.                   
  2224.              itemName             The name of the menu item (such
  2225.                                   as "New...")
  2226.  
  2227.              menuName             The name of the menu (such as
  2228.                                   "File")
  2229.  
  2230.              itemNumber           The number of the menu item
  2231.              menuNumber           The number of the menu
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.                                            HyperPAD 2.2 Addendum   37
  2241.             The itemNumber and menuNumber parameters to doMenu are numbered
  2242.             from 1 to the number of items in the menu. Dimmed menu items
  2243.             count as a valid place holder. For example, if you have a menu
  2244.             with three menu items, the first two of which are dimmed, then
  2245.             the itemNumber of the third menu item is 3, even though the menu
  2246.             appears to have only one menu item.
  2247.  
  2248.  
  2249.        Menus with no visible items
  2250.  
  2251.  
  2252.             If a menu has no visible items, there will be no corresponding
  2253.             pulldown menu. However, the menu names on the menu bar can still
  2254.             be selected. Selecting a menu name issues a doMenu message with
  2255.             the following parameters:
  2256.  
  2257.  
  2258.             itemName: Name of the item
  2259.             menuName: Name of the menu
  2260.             itemNumber: Item number (equal to 0)
  2261.             menuNumber: Menu number
  2262.  
  2263.  
  2264.        Writing a "Window" Menu
  2265.  
  2266.  
  2267.             The following PADtalk handlers implement a Windows-style "Window"
  2268.             menu that contains a list of the pads that have been accessed
  2269.             most recently. Selecting one of items from the Window menu will
  2270.             take you immediately to that pad.
  2271.  
  2272.  
  2273.  
  2274.  
  2275.  
  2276.  
  2277.  
  2278.  
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.  
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.        38 HyperPAD 2.2 Addendum
  2296.             The following handlers belong in the pad script of the Home pad:
  2297.  
  2298.  
  2299.                -- this handler gets control when an item is selected
  2300.                handler gotoPad(itemName,menuName,itemNumber);
  2301.                begin
  2302.                  go to pad itemName;
  2303.                end;
  2304.  
  2305.  
  2306.                handler quit;
  2307.                begin
  2308.                  global menuData;
  2309.  
  2310.  
  2311.                  -- put the file in the same place as HPAD.EXE
  2312.                  get findFile("HPAD.EXE");
  2313.                  set the delimiter to "\";
  2314.                  put "MENUS.DAT" into the last item of it;
  2315.                  set the delimiter to ",";
  2316.  
  2317.  
  2318.                  -- create the file and put the menu data into it
  2319.                  put create(it) into fh;
  2320.                  write menuData to fh;
  2321.                  close fh;
  2322.                  pass;
  2323.                end;
  2324.  
  2325.  
  2326.                -- this handler adds the pad named 'padName' to the Window
  2327.                menu
  2328.                handler addPadToMenu(padName);
  2329.                begin
  2330.                  global menuData;
  2331.                  if padName is in menuData then exit;
  2332.                  put padName &
  2333.                     ";FALSE;FALSE;gotoPad;Go to this pad.;;TRUE" after
  2334.                     the last line of menuData;
  2335.                end;
  2336.  
  2337.  
  2338.  
  2339.  
  2340.  
  2341.  
  2342.  
  2343.  
  2344.  
  2345.  
  2346.  
  2347.  
  2348.  
  2349.  
  2350.                                            HyperPAD 2.2 Addendum   39
  2351.                handler startup;
  2352.                begin
  2353.                  global menuData;
  2354.  
  2355.  
  2356.                  -- find the menu data file, if a previous one is around
  2357.                  get findFile("MENUS.DAT");
  2358.                  if it & "X" is not "X" then
  2359.                    begin
  2360.                      put open(it) into fh;
  2361.                      read from fh until end;
  2362.                      close fh;
  2363.                    end;
  2364.  
  2365.  
  2366.                  put it into menuData;
  2367.  
  2368.  
  2369.                  addPadToMenu the longName of this pad;
  2370.  
  2371.  
  2372.                  -- create the Window menu with the data from the file
  2373.                  create menu "Window";
  2374.                  put menuData into menu "Window";
  2375.                end;
  2376.  
  2377.  
  2378.                handler openPad;
  2379.                begin
  2380.                  global menuData;
  2381.  
  2382.  
  2383.                  -- Create the menu, if it isn't already there somewhere
  2384.                  if "Window" is not in the menus then
  2385.                    create menu "Window";
  2386.                  addPadToMenu the longName of this pad;
  2387.                  put menuData into menu "Window";
  2388.                end;
  2389.  
  2390.  
  2391.                handler resume;
  2392.                begin
  2393.                  startup;
  2394.                  pass;
  2395.                end;
  2396.  
  2397.  
  2398.  
  2399.  
  2400.  
  2401.  
  2402.  
  2403.  
  2404.  
  2405.  
  2406.  
  2407.  
  2408.        40 HyperPAD 2.2 Addendum
  2409.        Faster Language Execution
  2410.  
  2411.  
  2412.             The pcode interpreter built in to HyperPAD has been significantly
  2413.             optimized for speed and code size. The following table summarizes
  2414.             the improvements:
  2415.  
  2416.  
  2417.              Functional Area  Implications
  2418.  
  2419.              Looping          Loops involving counting
  2420.                               variables are faster
  2421.  
  2422.              Internal data    Assignments using the put
  2423.              conversions      command are faster
  2424.  
  2425.              Internal WORD    Significantly speeds up
  2426.              data type        arithmetic involving integers
  2427.                               (number without fractional
  2428.                               portions)
  2429.  
  2430.              Message passing  Messages get passed through the
  2431.                               hierarchy faster
  2432.  
  2433.              pcode            Script code is smaller and
  2434.              collapsing       faster
  2435.  
  2436.              Numeric          Comparing numbers in a boolean
  2437.              comparisons      expression is faster
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.  
  2450.  
  2451.  
  2452.  
  2453.  
  2454.  
  2455.  
  2456.  
  2457.  
  2458.  
  2459.  
  2460.  
  2461.  
  2462.  
  2463.  
  2464.  
  2465.  
  2466.                                            HyperPAD 2.2 Addendum   41
  2467.        PADtalk Enhancements
  2468.  
  2469.        New or Enhanced Properties
  2470.  
  2471.        brackets
  2472.  
  2473.  
  2474.             This property modifies the characters used to hold the check mark
  2475.             with check box buttons. The possible values are true and false;
  2476.             the default is true. Setting the brackets to true makes a button
  2477.             looks like this:
  2478.  
  2479.                [ ] New Button
  2480.  
  2481.  
  2482.             Setting the brackets to false makes a button look like this:
  2483.  
  2484.                ( ) New Button
  2485.  
  2486.  
  2487.             Parenthesis are used within option button groups (radio buttons)
  2488.             to distinguish them from regular option buttons.
  2489.  
  2490.  
  2491.             The following examples show how to change this property:
  2492.  
  2493.                set the brackets of page button 1 to false;
  2494.  
  2495.                set the brackets of button "Portrait" to true;
  2496.  
  2497.  
  2498.        delimiter
  2499.  
  2500.  
  2501.             This property changes the item delimiter (which is usually a
  2502.             comma) to another character:
  2503.  
  2504.                set the delimiter to "\";
  2505.  
  2506.                set the delimiter to "|";
  2507.  
  2508.  
  2509.             The delimiter can be set to any character from ASCII 1 to ASCII
  2510.             255. The following example saves the delimiter, changes it , then
  2511.             sets it back later:
  2512.  
  2513.                put the delimiter into savedDelimiter;
  2514.                set the delimiter to "#";
  2515.                put item 2 of "hello#there#person#wow"
  2516.                  into the message box;
  2517.                set the delimiter to savedDelimiter;
  2518.  
  2519.  
  2520.  
  2521.  
  2522.  
  2523.  
  2524.        42 HyperPAD 2.2 Addendum
  2525.             Note: The delimiter is set back to its default value (a comma)
  2526.             during idle time (at the end of all pending handlers).
  2527.  
  2528.  
  2529.        edgeType
  2530.  
  2531.  
  2532.             The range of field edge types is from 0 through 15. Edge type 0
  2533.             creates a field with a transparent edge. Thus, by setting the
  2534.             edgeType to 0, you can create a field with only a scroll bar
  2535.             visible. For example:
  2536.  
  2537.  
  2538.                -- no edge - keep scrollbar
  2539.                set the edgeType of page field 1 to 0;
  2540.                set the withEdge of page field 1 to true;
  2541.  
  2542.  
  2543.        focus
  2544.  
  2545.  
  2546.             The focus property can now be used to set the focus to objects
  2547.             while using the selector tool. This is especially useful for
  2548.             copying and pasting objects between pads. The following handler
  2549.             in a button script copies itself, then deletes itself, then
  2550.             pastes the copy of itself on another page.
  2551.  
  2552.  
  2553.                handler select;
  2554.                begin
  2555.                  doMenu "selector";     -- use the Selector tool
  2556.                  set the focus to me;   -- select this button
  2557.                  doMenu "Cut";          -- cut the button
  2558.                  go to the next page;   -- change pages
  2559.                  doMenu "Paste";        -- paste it here
  2560.                  doMenu "Browse";       -- go back to the Browse tool
  2561.                end;
  2562.  
  2563.  
  2564.        homePad
  2565.  
  2566.  
  2567.             The homePad property allows you to set the pad used as the Home
  2568.             pad. By default, the homePad property is set to HOME.PAD. If
  2569.             HyperPAD was unable to locate the home pad on startup, the value
  2570.             of homePad will be empty ("").
  2571.  
  2572.  
  2573.             You can set the homePad property to any valid pad. The new pad
  2574.             will replace the current home pad with the new one, re-routing
  2575.             all messages through the new pad (in effect, replacing the home
  2576.             pad in the message path).
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.                                            HyperPAD 2.2 Addendum   43
  2584.             Examples:
  2585.  
  2586.  
  2587.                -- change the Home pad to the Phone pad...
  2588.                set the homePad to "phone";
  2589.  
  2590.  
  2591.                -- get rid of the Home pad from the hierarchy..
  2592.                set the homePad to empty;
  2593.  
  2594.  
  2595.                -- set the home pad back to its default...
  2596.                set the homePad to "home";
  2597.  
  2598.  
  2599.                --
  2600.                -- The next example loads a different home pad containing some
  2601.                -- special routines, then re-loads the original home pad.
  2602.                --
  2603.                put the homePad into savedHomePad;
  2604.                set the homePad to "C:\HPAD22\SPECIAL.PAD";
  2605.                put specialFunction() into page field 1;
  2606.                set the homePad to savedHomePad;
  2607.  
  2608.  
  2609.             Note: The value of the homePad property is lost when you exit
  2610.             HyperPAD or run another program.
  2611.  
  2612.  
  2613.             Setting the homePad property also changes the pad that you go to
  2614.             when you select Home from the Go menu (or press ALT+F5).
  2615.  
  2616.  
  2617.             To remove the home pad from the message path, set the homePad
  2618.             property to empty.
  2619.  
  2620.  
  2621.             If you specify a DOS path, HyperPAD will look only in the
  2622.             specified directory for the pad. If you don't specify a path,
  2623.             HyperPAD will search for the specified pad in the following
  2624.             manner:
  2625.  
  2626.  
  2627.               o Append the PAD file extension (if there is no supplied file
  2628.                 extension)
  2629.  
  2630.               o Search the current directory
  2631.  
  2632.               o Search the directory specified by the HPADNET environment
  2633.                 variable
  2634.  
  2635.               o Search the directory where HPAD.EXE is located
  2636.  
  2637.               o Search every directory specified in the DOS path
  2638.  
  2639.               o Search the B: drive (if HyperPAD was started from a low
  2640.                 density disk (360K) in A:)
  2641.  
  2642.  
  2643.        44 HyperPAD 2.2 Addendum
  2644.        keyClick
  2645.  
  2646.  
  2647.             This global property, when true, causes an audible click when a
  2648.             key is pressed. The possible values are true or false; the
  2649.             default is false.
  2650.  
  2651.  
  2652.             Examples:
  2653.  
  2654.                set the keyClick to true;
  2655.  
  2656.                set the keyClick to false;
  2657.  
  2658.  
  2659.             Note: The key click is frequency 200 for a duration of 2
  2660.             milliseconds. If there is a play statement executing in the
  2661.             background, the key click will take priority. When the click is
  2662.             finished, the play statement will resume execution.
  2663.  
  2664.  
  2665.             The key click will only occur when a key is pressed. Autorepeat
  2666.             keys will not generate audible clicks.
  2667.  
  2668.  
  2669.        mouseAhead
  2670.  
  2671.  
  2672.             The mouseAhead property controls the ability to press the mouse
  2673.             button while HyperPAD is busy. If mouseAhead is true (the
  2674.             default), then mouse button presses are remembered by HyperPAD in
  2675.             the event queue. If mouseAhead is false, then mouse button
  2676.             presses are discarded from the event queue when you change pages
  2677.             or go to another pad.
  2678.  
  2679.  
  2680.             This property is especially useful if you have a button that
  2681.             takes a long time to process. When the user presses this button
  2682.             and doesn't receive immediate feedback, the user may be likely to
  2683.             press on the button again. However, if the page changes, the
  2684.             mouse button press will be processed by an unknown object on the
  2685.             new page. You can prevent this by setting the mouseAhead property
  2686.             to false.
  2687.  
  2688.  
  2689.             Examples:
  2690.  
  2691.  
  2692.                set the mouseAhead to false;
  2693.  
  2694.  
  2695.                set the mouseAhead to true;
  2696.  
  2697.  
  2698.             Note: The mouseAhead setting is recorded in the HPAD.INI file.
  2699.             This means that the setting is remembered even after you have
  2700.             exited HyperPAD.
  2701.  
  2702.  
  2703.                                            HyperPAD 2.2 Addendum   45
  2704.        wordWrap
  2705.  
  2706.  
  2707.             The new field property wordWrap allows you to specify where lines
  2708.             break in opaque, transparent, and scrolling fields. When wordWrap
  2709.             is true (the default), lines will break on the nearest word and
  2710.             at each carriage-return. When wordWrap is false, lines will break
  2711.             on carriage-returns only.
  2712.  
  2713.  
  2714.             Fields with the style listbox will only break lines on carriage-
  2715.             returns.
  2716.  
  2717.  
  2718.             Examples:
  2719.  
  2720.  
  2721.                set the wordWrap of page field 1 to false;
  2722.  
  2723.  
  2724.                set the wordWrap of page field 1 to true;
  2725.  
  2726.  
  2727.        New or Enhanced Messages
  2728.  
  2729.  
  2730.        idle
  2731.  
  2732.  
  2733.             In version 2.0, idle was sent to the current page each time
  2734.             through the main event loop. In version 2.2, idle is sent only
  2735.             when another event is not waiting in the event queue. This will
  2736.             affect pads that assume that idle gets sent at the end of all
  2737.             pending handlers.
  2738.  
  2739.  
  2740.             mark and unMark
  2741.  
  2742.  
  2743.             The mark and unMark messages can now be sent to listbox fields in
  2744.             order to mark or unMark a series of lines.
  2745.  
  2746.  
  2747.             Examples:
  2748.  
  2749.  
  2750.                send "mark" 1,2,5,6 to page field 1;
  2751.  
  2752.  
  2753.                send "unMark" 3,5,6 to page field "list";
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.        46 HyperPAD 2.2 Addendum
  2764.        New or Enhanced Commands
  2765.  
  2766.  
  2767.        ask
  2768.  
  2769.  
  2770.             The ask command has been enhanced with the keyword "password", as
  2771.             shown in the following example:
  2772.  
  2773.  
  2774.                ask password "What is the password, hombre?";
  2775.  
  2776.  
  2777.             This command will allow the user to type normally using backspace
  2778.             and other editing keys, except that keyPress pound signs (#) will
  2779.             be echoed in place of printable characters.
  2780.  
  2781.  
  2782.             The user's response (what was actually typed -- not the pound
  2783.             signs) is returned in the variable "it".
  2784.  
  2785.  
  2786.        convert
  2787.  
  2788.  
  2789.             The convert command has been changed to allow 4 digit years.
  2790.             Thus, in the short date format has been extended to allow the
  2791.             following:
  2792.  
  2793.  
  2794.              Command                 Format       Example
  2795.  
  2796.              convert it to short     MM/DD/YY     1/31/91
  2797.              date;
  2798.  
  2799.              convert it to short4    MM/DD/YYYY   1/31/1991
  2800.              date;
  2801.  
  2802.  
  2803.             To convert a date to the format containing 4 digit years, use the
  2804.             "short4 date" date type as in the following example:
  2805.  
  2806.  
  2807.                get the seconds;
  2808.                convert it to short4 date;
  2809.  
  2810.  
  2811.             The date() function still returns dates in the short format (2
  2812.             digit years), such as 10/21/90. When converting from short dates
  2813.             with 2 digit years, HyperPAD assumes the current century. For
  2814.             example, "10/10/00" will translate to 1900 because the current
  2815.             century is 1900.
  2816.  
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.                                            HyperPAD 2.2 Addendum   47
  2825.             To get a complete date specification in short format with 4 digit
  2826.             years:
  2827.  
  2828.  
  2829.                -- old way
  2830.                get the date;
  2831.  
  2832.  
  2833.                -- new way
  2834.                get the seconds
  2835.                convert it to short4 date;
  2836.  
  2837.  
  2838.        dial
  2839.  
  2840.  
  2841.             The dial command now supports COM3 and COM4. To use these
  2842.             additional serial ports, use the following commands:
  2843.  
  2844.  
  2845.                set the modem to "COM3";
  2846.  
  2847.  
  2848.                set the modem to "COM4";
  2849.                dial "315-4743400";
  2850.  
  2851.  
  2852.                get the modem;
  2853.                if it is "COM3" then
  2854.                  answer "You have many serial ports!";
  2855.  
  2856.  
  2857.        do
  2858.  
  2859.  
  2860.             The result of the do command can be determined by examining the
  2861.             result() function. This function returns error if there was a
  2862.             syntax error compiling the statement or empty if there was no
  2863.             error.
  2864.  
  2865.  
  2866.             Examples:
  2867.  
  2868.                ask "Type in a statement:";
  2869.                do it;
  2870.                if the result is "error" then
  2871.                  answer "There was an error compiling that statement.";
  2872.  
  2873.  
  2874.        fxshow
  2875.  
  2876.  
  2877.             HyperPAD now supports the no-credits version of the Show Partner
  2878.             F/X runtime called FXNOSHOW.EXE (version 3.6 or above). This
  2879.             program will only display mastered shows having the .PR2 file
  2880.             extension. In order to use FXNOSHOW, put the program into the
  2881.             same directory as HPAD.EXE and run HyperPAD. HyperPAD will search
  2882.  
  2883.  
  2884.        48 HyperPAD 2.2 Addendum
  2885.             for the program name and check a signature. To use the program
  2886.             from within HyperPAD use the "fxshow" command as follows:
  2887.  
  2888.  
  2889.                fxshow "sample.pr2";
  2890.  
  2891.  
  2892.             If both FXSHOW.EXE and FXNOSHOW.EXE are in the HyperPAD
  2893.             directory, HyperPAD will use FXSHOW.EXE.
  2894.  
  2895.  
  2896.             You will receive no credits if you are using FXNOSHOW.EXE.
  2897.  
  2898.  
  2899.             Command Line Parameters
  2900.  
  2901.             The fxshow command accepts optional parameters. For example, to
  2902.             disable the use of EMS memory in FXSHOW, use the following
  2903.             command:
  2904.  
  2905.  
  2906.                fxshow "sample.pro /n";
  2907.  
  2908.  
  2909.             The /k parameter causes FXSHOW to return the last key pressed in
  2910.             the function result(). This is useful if you want to display a
  2911.             show and evaluate the last key that was pressed during the show
  2912.             from within HyperPAD. The following example displays the show
  2913.             called "sample.pro" and saves the last key that was pressed :
  2914.  
  2915.  
  2916.                fxshow "sample.pro /k";
  2917.  
  2918.  
  2919.             To evaluate the last key, create a resume handler in the page
  2920.             script. For example:
  2921.  
  2922.  
  2923.                handler resume;
  2924.                begin
  2925.                  if the result() is 27 then quit;
  2926.                end;
  2927.  
  2928.  
  2929.             In this case, the result() function returns the ASCII code of the
  2930.             last key that the user pressed while in FXSHOW.EXE. If the last
  2931.             key pressed is a special key (i.e., a function key or a key on
  2932.             the numeric keypad), the result() function will return the scan
  2933.             code of that key plus 128. Thus, if the result is greater than
  2934.             128, subtract 128 and examine the resulting scan code.
  2935.  
  2936.  
  2937.  
  2938.  
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944.  
  2945.                                            HyperPAD 2.2 Addendum   49
  2946.             For example, the following resume handler evaluates the last key
  2947.             pressed in FXSHOW.EXE:
  2948.  
  2949.  
  2950.                handler resume;
  2951.                begin
  2952.                  get the result;
  2953.                  if it > 128 then
  2954.                    begin
  2955.                      subtract 128 from it;    -- get the scan code
  2956.                      if it is 59 then
  2957.                        answer "The last key pressed was F1"
  2958.                      else if it is 72 then
  2959.                        answer "The last key was up arrow";
  2960.                    end;
  2961.                end;
  2962.  
  2963.  
  2964.        go
  2965.  
  2966.  
  2967.             When using the PADtalk command:
  2968.  
  2969.  
  2970.                go to pad <padName>;
  2971.  
  2972.  
  2973.             If <padName> doesn't contain a path specification, HyperPAD will
  2974.             search in a number of different directories until the desired pad
  2975.             is located. Beginning with version 2.2, HyperPAD will first
  2976.             search for the pad in the same directory as the current pad. If
  2977.             the pad is not located within the same directory as the current
  2978.             pad, the remaining directories (detailed on page 135 of the
  2979.             PADtalk Reference Guide) are searched as normal.
  2980.  
  2981.  
  2982.             query
  2983.  
  2984.  
  2985.             After a query, the following statements can be used to navigate
  2986.             between the pages included in the query subset:
  2987.  
  2988.  
  2989.                -- go to the first page in the subset
  2990.                go to the first page;
  2991.  
  2992.  
  2993.                -- go to the last page in the subset
  2994.                go to the last page;
  2995.  
  2996.  
  2997.                -- go to the next page in the subset
  2998.                doMenu "Next";
  2999.  
  3000.  
  3001.                -- go to the previous page in the subset
  3002.                doMenu "Previous";
  3003.  
  3004.  
  3005.        50 HyperPAD 2.2 Addendum
  3006.             The following statements change to physical pages, regardless of
  3007.             whether the page is included in the query subset:
  3008.  
  3009.  
  3010.                go to the next page;
  3011.  
  3012.                go to the previous page;
  3013.  
  3014.                go to page 1;
  3015.  
  3016.                go to page 10;
  3017.  
  3018.  
  3019.        send
  3020.  
  3021.  
  3022.             The send command now changes the target to the destination
  3023.             object. When a message is explicitly sent to another object, the
  3024.             target is temporarily changed to that object. When the
  3025.             destination object finishes execution, the target is restored to
  3026.             its original value.
  3027.  
  3028.  
  3029.             Examples:
  3030.  
  3031.  
  3032.             This handler appears in page button is 1:
  3033.  
  3034.  
  3035.                handler select;
  3036.                begin
  3037.                  put the target;
  3038.                  send "select" to page button id 2;
  3039.                  put the target;
  3040.                end;
  3041.  
  3042.  
  3043.             The following handler appears in page button id 2:
  3044.  
  3045.  
  3046.                handler select;
  3047.                begin
  3048.                  put the target;
  3049.                end;
  3050.  
  3051.  
  3052.             After selecting page button id 1 (and running its select
  3053.             handler), the message box will display the following in this
  3054.             order:
  3055.  
  3056.  
  3057.                page button id 1
  3058.  
  3059.                page button id 2
  3060.  
  3061.                page button id 1
  3062.  
  3063.  
  3064.                                            HyperPAD 2.2 Addendum   51
  3065.        sort
  3066.  
  3067.  
  3068.             The sort command has a limitation not discussed in the PADtalk
  3069.             Reference Guide, namely that field references cannot contain page
  3070.             or background specifications. For example, the following is
  3071.             allowed:
  3072.  
  3073.  
  3074.                sort by field 1;
  3075.  
  3076.  
  3077.             The following, however, is not allowed:
  3078.  
  3079.  
  3080.                sort by field 1 of page 2;
  3081.  
  3082.  
  3083.             If you want to sort using a background field on a different
  3084.             background, you can use the following code:
  3085.  
  3086.  
  3087.                go to page 1 of background 1;
  3088.  
  3089.                sort by field 1;
  3090.  
  3091.  
  3092.             If you attempt to include a page or background reference, you
  3093.             will receive syntax error 16: "Page or background specification
  3094.             is not allowed in a sort expression.".
  3095.  
  3096.  
  3097.        New or Enhanced Functions
  3098.  
  3099.        dirExists()
  3100.  
  3101.  
  3102.             This function returns true if a specified directory is a valid;
  3103.             otherwise it returns false. The directory can be on the same
  3104.             drive or another drive.
  3105.  
  3106.  
  3107.             Examples:
  3108.  
  3109.                if dirExists("C:\123\SHEETS") then beep;
  3110.  
  3111.  
  3112.                if not dirExists(page field "dirName") then go home;
  3113.  
  3114.  
  3115.                -- ask for a directory, then change to it if it exists
  3116.                ask "What directory to change to?" with directory();
  3117.                if it is empty then exit;
  3118.                if dirExists(it) then set the currentDirectory to it
  3119.                else answer "Invalid directory!" with "Ok";
  3120.  
  3121.  
  3122.  
  3123.  
  3124.        52 HyperPAD 2.2 Addendum
  3125.        extensions()
  3126.  
  3127.  
  3128.             This function returns a comma-separated list of the names of
  3129.             external handlers and functions that are currently loaded.
  3130.             Extensions in both the current pad and the home pad are returned.
  3131.  
  3132.  
  3133.             Examples:
  3134.  
  3135.                put the extensions into page field 1;
  3136.  
  3137.  
  3138.                if "blinkon" is in extensions() then blinkon;
  3139.  
  3140.  
  3141.                put the extensions into page field "list";
  3142.  
  3143.  
  3144.        history()
  3145.  
  3146.  
  3147.             This function returns a comma-separated list of the unique names
  3148.             of the most recently accessed pages. Up to 100 page names may be
  3149.             returned. For example, the following list may be returned:
  3150.  
  3151.  
  3152.                page id 4 of pad "C:\HPAD\HOME.PAD",page id 16 of pad
  3153.                "C:\HPAD\PHONE.PAD",page id 3 of pad "C:\HPAD\RUN.PAD";
  3154.  
  3155.  
  3156.             Examples:
  3157.  
  3158.  
  3159.                put the history into page field 1;
  3160.  
  3161.  
  3162.                -- create a history list (separated by CRs)...
  3163.                put substitute(history(),",",return) into
  3164.                  page field "List";
  3165.  
  3166.  
  3167.                -- go to the first page visited...
  3168.                get item 1 of history();
  3169.                go to page id (word 3 of it) of pad (word 6 of it);
  3170.  
  3171.  
  3172.             The following example displays the history in a listbox field
  3173.             called "PreviousPages":
  3174.  
  3175.  
  3176.                get the history;
  3177.                get substitute(it,",",return);
  3178.                put it into page field "PreviousPages";
  3179.  
  3180.  
  3181.  
  3182.  
  3183.  
  3184.  
  3185.                                            HyperPAD 2.2 Addendum   53
  3186.        open(), append(), and create()
  3187.  
  3188.  
  3189.             HyperPAD now limits the number of open files to 10. If you
  3190.             attempt to open more than ten files (using open(), create() or
  3191.             append()), you will receive the runtime error message number 59:
  3192.             "Too many open files.".
  3193.  
  3194.  
  3195.             With version 2.2 of HyperPAD, the numbers returned from open(),
  3196.             create(), and append() are the same as the corresponding DOS file
  3197.             handle numbers. Thus, you can reference the open DOS files from
  3198.             extensions.
  3199.  
  3200.  
  3201.             Examples:
  3202.  
  3203.                put the open of "data.dat" into fh;
  3204.                close fh;
  3205.  
  3206.  
  3207.                put the create of "newfile.txt" into fh;
  3208.                write page field 1 to fh;
  3209.                close fh;
  3210.  
  3211.  
  3212.             programName
  3213.  
  3214.  
  3215.             This function returns the name of the HyperPAD program that is
  3216.             currently running. The possible return values are:
  3217.  
  3218.  
  3219.              Possible Value  Description
  3220.  
  3221.              HyperPAD        Standard HyperPAD development
  3222.                              environment
  3223.  
  3224.              HyperPAD        Runtime version of HyperPAD
  3225.              Browser
  3226.  
  3227.              HyperPAD Easy   OEM version of HyperPAD
  3228.  
  3229.              HyperPAD        Old runtime version of HyperPAD
  3230.              Reader          with menus
  3231.  
  3232.              HyperHost       HyperPAD development environment
  3233.                              with host connectivity software
  3234.  
  3235.              HyperHost       Runtime version of HyperHost
  3236.              Browser
  3237.  
  3238.  
  3239.  
  3240.  
  3241.  
  3242.  
  3243.  
  3244.  
  3245.        54 HyperPAD 2.2 Addendum
  3246.        printLoc()
  3247.  
  3248.  
  3249.             This function returns the internal printhead position (used with
  3250.             the print at command) in the format X,Y.
  3251.  
  3252.  
  3253.             When printing using the print at command, HyperPAD internally
  3254.             keeps track of the X and Y character positions on the print head
  3255.             on the page. This is done in order to move the printhead to
  3256.             different locations on the page using the syntax:
  3257.  
  3258.                print "hello world" at 10,10;
  3259.  
  3260.  
  3261.             The printLoc() function returns undefined values if the printer
  3262.             is not currently on. (You can turn the printer on and off using
  3263.             the global property: printer.)
  3264.  
  3265.  
  3266.             The following sequence shows how different statements affect the
  3267.             internal printhead position:
  3268.  
  3269.  
  3270.                put the printLoc();     -- undefined X,Y values (printer
  3271.                                        -- is not on!)
  3272.  
  3273.                set the printer to on;
  3274.                put the printLoc();     -- puts 1,1 into the message box
  3275.                                        -- (default starting position)
  3276.  
  3277.                print "Hello";
  3278.                put the printLoc();     -- puts 6,1 into the message box
  3279.  
  3280.  
  3281.                print return & return;
  3282.                put the printLoc();     -- puts 1,3 into the message box
  3283.  
  3284.  
  3285.                print "Hello" at 10,10;
  3286.                put the printLoc();     -- puts 15,10 into the message box
  3287.  
  3288.  
  3289.                print formfeed;
  3290.                put the printLoc();     -- puts 1,1 into the message box
  3291.                                        -- (resets to top of page)
  3292.  
  3293.                set the printer to off;
  3294.                put the printLoc();     -- undefined X,Y values
  3295.  
  3296.  
  3297.             Examples:
  3298.  
  3299.  
  3300.                if item 2 of the printLoc >= 66 then
  3301.                  print formfeed;
  3302.  
  3303.  
  3304.                                            HyperPAD 2.2 Addendum   55
  3305.                if item 1 of printLoc() > 80 then print return;
  3306.  
  3307.  
  3308.        random()
  3309.  
  3310.  
  3311.             The upper limit of random numbers generated by HyperPAD has been
  3312.             changed to 4294967296 (or 2^32).  Further, the random function
  3313.             will also work with negative numbers, returning a value between -
  3314.             1 and the lower bound you specify.
  3315.  
  3316.  
  3317.             Examples:
  3318.  
  3319.  
  3320.                put random(1000);   -- returns a number between 1 and 1000
  3321.  
  3322.                put random(-1000);-- returns a number between -1 and -1000
  3323.  
  3324.                put random(4000000); -- get a big random number
  3325.  
  3326.                put the random of (4123456) into the message box;
  3327.  
  3328.  
  3329.        ticks()
  3330.  
  3331.  
  3332.             The ticks() function returns the number of millisecond (1/1000)
  3333.             ticks since HyperPAD was run. In HyperPAD 2.2, this number is
  3334.             accurate to 1/18 of a second (instead of 1/1000) of a second.
  3335.  
  3336.  
  3337.                get the ticks;
  3338.                for i = 1 to 10 do go to the next page;
  3339.                answer "That took" && ticks() - it && "milliseconds";
  3340.  
  3341.  
  3342.             When timing different events, remember that the HyperPAD
  3343.             instructions take time to execute too.
  3344.  
  3345.  
  3346.        Enhanced Objects
  3347.  
  3348.  
  3349.        currentObject object
  3350.  
  3351.  
  3352.             The currentObject object can now be used as an object reference
  3353.             while using the Selector tool.
  3354.  
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362.  
  3363.  
  3364.        56 HyperPAD 2.2 Addendum
  3365.        Extension Enhancements
  3366.  
  3367.        New Extension Callbacks
  3368.  
  3369.             The following list describes the new callback functions available
  3370.             to extensions.
  3371.  
  3372.  
  3373.              Routine      Description
  3374.  
  3375.              GetGlobals   Returns a comma-separated list of
  3376.                           global variables
  3377.  
  3378.              GetScreen    Retrieves the character and
  3379.                           attribute information from a
  3380.                           rectangular area of the paint layer
  3381.                           of the current page or background
  3382.  
  3383.              SetKeyHook   Installs a keyboard intercept
  3384.                           routine
  3385.  
  3386.              SetScreen    Sets character and attribute
  3387.                           information of a rectangle of the
  3388.                           paint layer of the current page or
  3389.                           background
  3390.  
  3391.              TranslateKey Translated a key name to a numeric
  3392.                           value
  3393.  
  3394.  
  3395.             To use these new callback functions, you must use the following
  3396.             new files:
  3397.  
  3398.  
  3399.               o STARTUP.LIB
  3400.  
  3401.               o EXTERN.H
  3402.  
  3403.               o EXTERN.INC
  3404.  
  3405.               o KEYCODES.H
  3406.  
  3407.  
  3408.        GetGlobals()
  3409.  
  3410.  
  3411.             Syntax:
  3412.  
  3413.                hNames = GetGlobals();
  3414.  
  3415.  
  3416.                HANDLE hNames;
  3417.  
  3418.  
  3419.             Purpose: This returns a comma separated list of all the global
  3420.             variable names. When used with SetGlobal() and GetGlobal(), an
  3421.             extension could, for example:
  3422.  
  3423.  
  3424.                                            HyperPAD 2.2 Addendum   57
  3425.               o Put empty into all of the global variables in HPAD
  3426.  
  3427.               o Save all the global variables to a file
  3428.  
  3429.               o Read global variable names and values from a file and set
  3430.                 them in HPAD
  3431.  
  3432.  
  3433.             If there are three global variables in HyperPAD called i, j, and
  3434.             k, then GetGlobals() will return "i,j,k".
  3435.  
  3436.  
  3437.             Examples:
  3438.  
  3439.  
  3440.                // This code prints out the names and contents
  3441.                // of all the global variables currently declared
  3442.                // in HyperPAD.
  3443.  
  3444.  
  3445.                HANDLE hGlobals;
  3446.                HANDLE hName;
  3447.                HANDLE hValue;
  3448.                PTR s,d;
  3449.  
  3450.                hGlobals = GetGlobals();  // get the global variable names
  3451.                hName = NewHandle(50);    // temporary space to hold single
  3452.                names
  3453.                s = LockHandle(hGlobals); // s = pointer to the names
  3454.  
  3455.                while (TRUE) {
  3456.                    // copy a global variable name to hName
  3457.                    d = deref(hName);
  3458.                    while (*d && *d != ',') *d++ = *s++;
  3459.                    *d = '\0';
  3460.  
  3461.  
  3462.                    // get the variable's value
  3463.                    hValue = GetGlobal(hName);
  3464.  
  3465.  
  3466.                    // print them out
  3467.                    printf("Global %s = %s\n",deref(hName),deref(hValue));
  3468.  
  3469.  
  3470.                    // next global variable
  3471.                    if (*s) s++;
  3472.                    else break;
  3473.                }
  3474.  
  3475.                //cleanup
  3476.                UnLockHandle(hGlobals);
  3477.                FreeHandle(hName);
  3478.  
  3479.  
  3480.  
  3481.  
  3482.        58 HyperPAD 2.2 Addendum
  3483.        GetScreen()
  3484.  
  3485.  
  3486.             Syntax:
  3487.  
  3488.                hdl = GetScreen(IsPage,x1,y1,x2,y2);
  3489.  
  3490.  
  3491.                HANDLE hdl;      /* handle to the screen data */
  3492.                BOOLEAN IsPage;  /* TRUE = page, FALSE = background */
  3493.                int x1,y1,x2,y2; /* screen rectangle coordinates */
  3494.  
  3495.  
  3496.             Purpose: This function returns the screen data from a specified
  3497.             rectangle from the paint layer of either the current page or
  3498.             current background.
  3499.  
  3500.  
  3501.             The function returns the character and attribute data within the
  3502.             rectangle specified by the upper left corner of (x1,y1) and the
  3503.             lower right corner of (x2,y2). The screen data is of the form:
  3504.  
  3505.  
  3506.                <character>,<attribute>,<character>,<attribute>....
  3507.  
  3508.  
  3509.             The size (in bytes) of the returned handle can be calculated as
  3510.             follows:
  3511.  
  3512.  
  3513.                (x2-x1+1)*2 + (y2-y1+1)
  3514.  
  3515.  
  3516.             The returned data is of a form suitable for use with SetScreen().
  3517.  
  3518.  
  3519.             Note: This function allocates a handle. It is the responsibility
  3520.             of the extension to free this handle.
  3521.  
  3522.  
  3523.  
  3524.  
  3525.  
  3526.  
  3527.  
  3528.  
  3529.  
  3530.  
  3531.  
  3532.  
  3533.  
  3534.  
  3535.  
  3536.  
  3537.  
  3538.  
  3539.  
  3540.  
  3541.                                            HyperPAD 2.2 Addendum   59
  3542.             Examples:
  3543.  
  3544.                /*
  3545.                ** this code copies the paint layer from the current
  3546.                ** page to the next page.
  3547.                */
  3548.  
  3549.  
  3550.                HANDLE hdl;
  3551.                HANDLE hcmd;
  3552.  
  3553.  
  3554.                /* get the screen data */
  3555.                hdl = GetScreen(TRUE,1,1,80,25);
  3556.  
  3557.  
  3558.                /* issue command to HyperPAD to go to the next page */
  3559.                hcmd = stoh("go to the next page");
  3560.                Do(hcmd);
  3561.                FreeHandle(hcmd);
  3562.  
  3563.  
  3564.                /* set the paint layer of the new page */
  3565.                SetScreen(TRUE,1,1,80,25,deref(hdl));
  3566.  
  3567.  
  3568.                /* free the screen data (no longer needed) */
  3569.                FreeHandle(hdl);
  3570.  
  3571.  
  3572.        SetKeyHook()
  3573.  
  3574.  
  3575.             Syntax:
  3576.  
  3577.                SetKeyHook(trap);
  3578.  
  3579.  
  3580.                WORD _loadds (*trap)(WORD);
  3581.  
  3582.  
  3583.             Purpose: This routine enables an extension to insert a keyboard
  3584.             interceptor into HyperPAD message path. This interceptor will
  3585.             receive keystrokes before the key enters the hierarchy, thereby
  3586.             allowing the extension to provide a keyboard filter.
  3587.  
  3588.  
  3589.             The filter routine accepts one parameter (the key -- WORD) and
  3590.             returns the key to HyperPAD. If zero is returned, the key will be
  3591.             ignored. The interceptor must preserve and set DS to its own
  3592.             value.
  3593.  
  3594.  
  3595.  
  3596.  
  3597.  
  3598.  
  3599.  
  3600.  
  3601.        60 HyperPAD 2.2 Addendum
  3602.             Examples:
  3603.  
  3604.             The following example extension uses a keyboard interceptor to
  3605.             filter out lower case letters, allowing only their upper case
  3606.             equivalents. The PADtalk code used in conjunction with this
  3607.             extension is provided afterward.
  3608.  
  3609.  
  3610.                #include <ctype.h>
  3611.                #include "extern.h"
  3612.  
  3613.  
  3614.                /*
  3615.                ** This keyboard hook filters all alphabetic characters,
  3616.                ** passing only the upper case equivalents.
  3617.                **
  3618.                ** Keyboard hooks must save the DS register (using
  3619.                ** _loadds)
  3620.                */
  3621.  
  3622.  
  3623.                WORD _loadds trap(WORD KeyWord)
  3624.                {
  3625.                  WORD w;
  3626.                  w = KeyWord & 0x00FF;    /* w = ASCII code */
  3627.                  if (w) {
  3628.                      if (isalpha(w))
  3629.                       return((KeyWord & 0xFF00) | toupper(w));
  3630.                  }
  3631.                  return(KeyWord);
  3632.                }
  3633.  
  3634.  
  3635.                startHook()
  3636.                {
  3637.                  SetKeyHook(trap);  /* set to my routine */
  3638.                  return(STOP);
  3639.                }
  3640.  
  3641.  
  3642.                stopHook()
  3643.                {
  3644.                  SetKeyHook(NULL);  /* set to nothing removes hook */
  3645.                  return(STOP);
  3646.                }
  3647.  
  3648.  
  3649.  
  3650.  
  3651.  
  3652.  
  3653.  
  3654.  
  3655.  
  3656.  
  3657.                                            HyperPAD 2.2 Addendum   61
  3658.                /*
  3659.                ** Remove the keyboard hook when the extension
  3660.                ** is removed from memory.
  3661.                */
  3662.                pascal far WhenUnLoaded()
  3663.                {
  3664.                  stopHook();
  3665.                }
  3666.  
  3667.                POOL pascal Pool[] = {
  3668.                  {    "startHook",   startHook,     0    HANDLER},
  3669.                  {    "stopHook",         stopHook, 0,   HANDLER},
  3670.                  {    NULL,               NULL,          0,   0}   };
  3671.  
  3672.  
  3673.             These PADtalk handlers should appear within the script of a field
  3674.             that requires only upper case input:
  3675.  
  3676.  
  3677.                handler openField;
  3678.                begin
  3679.                  startHook;
  3680.                end;
  3681.  
  3682.                handler closeField;
  3683.                begin
  3684.                  stopHook;
  3685.                end;
  3686.  
  3687.  
  3688.        SetScreen()
  3689.  
  3690.  
  3691.             Syntax:
  3692.  
  3693.  
  3694.                SetScreen(IsPage,x1,y1,x2,y2,data);
  3695.  
  3696.                BOOLEAN IsPage;  // TRUE the page, else FALSE
  3697.                int x1,y1,x2,y2; // rectangle to change
  3698.                PTR data;        // place to put the data
  3699.  
  3700.  
  3701.             Purpose: This routine permanently changes a portion of the paint
  3702.             layer of the current page or background with data from a buffer
  3703.             that you supply. The data buffer contains both character and
  3704.             attribute information in the form:
  3705.  
  3706.  
  3707.                <character><attribute><character><attribute>...
  3708.  
  3709.  
  3710.             You can get data from the paint layer in this format using the
  3711.             GetScreen() function.
  3712.  
  3713.  
  3714.  
  3715.  
  3716.        62 HyperPAD 2.2 Addendum
  3717.             Examples:             
  3718.             The following example clears the 25th line of the page:
  3719.  
  3720.  
  3721.                char buf[160];   // 160 bytes (80 chars and 80 attrs)
  3722.                PTR p;      // roving pointer into the buffer
  3723.                int i;      // loop counter
  3724.  
  3725.  
  3726.                // initialize the buffer with blank space...
  3727.                for (i=0,p=buf;i<80;i++) {
  3728.                    *p++ = ' ';       // character
  3729.                    *p++ = 7;         // attribute
  3730.                }
  3731.  
  3732.  
  3733.                // copy the data to the paint layer and refresh...
  3734.                SetScreen(TRUE,1,25,80,25,buf);
  3735.  
  3736.  
  3737.        TranslateKey()
  3738.  
  3739.  
  3740.             Syntax:
  3741.  
  3742.                key = TranslateKey(keyName);
  3743.  
  3744.                WORD key;
  3745.                STRING keyName;
  3746.  
  3747.             Purpose: This function enables an extension to translate a key,
  3748.             represented as a string, into a number. For example:
  3749.  
  3750.  
  3751.                WORD w;
  3752.  
  3753.  
  3754.                w = TranslateKey("enter");       // returns 7181
  3755.  
  3756.  
  3757.        Sample Extensions
  3758.  
  3759.  
  3760.             If you chose to install the sample extensions, a subdirectory
  3761.             called EXTERN was created off your HyperPAD directory. This
  3762.             directory contains a number of sample extensions that you can use
  3763.             within your own pads. Included with each extension are the
  3764.             following:
  3765.  
  3766.  
  3767.               o The compiled form of the extension suitable for use with the
  3768.                 MOVER program (Example: TEST.EXE).
  3769.  
  3770.  
  3771.               o The make file used to compile and link the extension. These
  3772.                 files have no file extension (example: TEST.).
  3773.  
  3774.  
  3775.                                            HyperPAD 2.2 Addendum   63
  3776.               o A pad showing how to use the handlers and function provided
  3777.                 in that extension (example: TEST.PAD). Not all extensions
  3778.                 have a sample pad.
  3779.  
  3780.  
  3781.               o The source files needed to create that extension (example:
  3782.                 TEST.C or TEST.ASM).
  3783.  
  3784.  
  3785.             Each extension was created using Microsoft C 5.1 or Microsoft
  3786.             Macro Assembler version 5.0.
  3787.  
  3788.  
  3789.             Within the EXTERN directory are two sub-directories: STARTUP and
  3790.             IO. The STARTUP directory contains the source code for the
  3791.             startup library (STARTUP.LIB) that is linked with every
  3792.             extension. Use care if you modify this code. The IO directory
  3793.             contains the source for the I/O library (IO.LIB) that is also
  3794.             used in many extensions. If you do not need the source code for
  3795.             these two libraries, then you can delete the files and remove the
  3796.             corresponding subdirectories.
  3797.  
  3798.  
  3799.  
  3800.  
  3801.  
  3802.  
  3803.  
  3804.  
  3805.  
  3806.  
  3807.  
  3808.  
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.        64 HyperPAD 2.2 Addendum
  3830.             The following table describes the new extensions included with
  3831.             version 2.2:
  3832.  
  3833.              Extension  Description
  3834.  
  3835.              BARCHART   Graphs data as a bar chart (640x200
  3836.                         BW graphics mode).
  3837.  
  3838.              BASE       Converts numbers to and from other
  3839.                         bases (such as hex or binary).
  3840.  
  3841.              BLINK      Toggles blinking attributes on/off.
  3842.  
  3843.              BOOT       Reboots the computer (from a read-
  3844.                         only pad).
  3845.  
  3846.              BORDER     Sets the border color on the display.
  3847.  
  3848.              CLEARBUF   Clears the event queue of all
  3849.                         keyboard and mouse events.
  3850.  
  3851.              CLICKAT    Simulates a mouse click anywhere on
  3852.                         the screen.
  3853.  
  3854.              CSORT      Sorts items or lines of text.
  3855.  
  3856.              DOS        DOS functions, such as md, rd, copy,
  3857.                         and del.
  3858.  
  3859.              FF         Locates a file anywhere on a disk.
  3860.  
  3861.              FIXENV     Causes HyperPAD to use the
  3862.                         environment of COMMAND.COM rather
  3863.                         than the copy created for it by DOS.
  3864.                         This is useful for running some
  3865.                         network programs.
  3866.  
  3867.              FONT       Changes the text font on EGA or VGA
  3868.                         cards.
  3869.  
  3870.              FORMAT     Word wraps a text string for display
  3871.                         in a field.
  3872.  
  3873.              GETSCR     Copies and pastes the paint layer of
  3874.                         the page or background.
  3875.  
  3876.              GLOBALS    Saves and reads global variables to
  3877.                         and from a file.
  3878.  
  3879.              HORLINE    Draws a horizontal line of characters
  3880.                         and attributes on the paint layer of
  3881.                         the page or background.
  3882.  
  3883.              INFO       Returns information about the
  3884.                         computer and memory configuration.
  3885.  
  3886.              ISSUBST    Determines if a drive is a DOS SUBST
  3887.                         drive.
  3888.  
  3889.                                            HyperPAD 2.2 Addendum   65
  3890.              KEEP       Causes HyperPAD not to clear the
  3891.                         screen when running other programs.
  3892.  
  3893.              KEYHOOK    Shows how to intercept keys before
  3894.                         they enter the HyperPAD message path.
  3895.  
  3896.              LOWIO      Low level DOS I/O functions.
  3897.  
  3898.              MONTH      Creates a calendar month for display
  3899.                         in a field.
  3900.  
  3901.              NUMBER     Creates enlarged numeric digits for
  3902.                         display in a field.
  3903.  
  3904.              SCAN       Reads in a directory tree of a
  3905.                         specified disk drive and returns the
  3906.                         structure formatted as text for
  3907.                         display in a field.
  3908.  
  3909.              SETPAL     Modifies the palette registers and
  3910.                         DAC values of the EGA and VGA.
  3911.  
  3912.              SETSCR     Shows how to set the paint layer of a
  3913.                         page or background.
  3914.  
  3915.              SWITCH     Switches between monitors -- used
  3916.                         with computers with both monochrome
  3917.                         and color monitors.
  3918.  
  3919.              TEST       Sample C extension showing a handler
  3920.                         and a function.
  3921.  
  3922.              TESTASM    Sample ASM extension.
  3923.  
  3924.              TSR        A sample of a TSR program that
  3925.                         registers itself with HyperPAD and
  3926.                         executes some HyperPAD callback
  3927.                         functions when invoked.
  3928.  
  3929.              VIEWGX2    Views a graphics GX2 file.
  3930.  
  3931.              WITEM      Returns the item number, given the
  3932.                         item's value.
  3933.  
  3934.  
  3935.  
  3936.  
  3937.  
  3938.  
  3939.  
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.        66 HyperPAD 2.2 Addendum
  3948.        Support for TSR Programs
  3949.  
  3950.  
  3951.             HyperPAD now has additional support for TSR programs. This
  3952.             support allows TSR programs to:
  3953.  
  3954.  
  3955.               o Invoke themselves in a safe manner that will not conflict
  3956.                 with HyperPAD.
  3957.  
  3958.  
  3959.               o Make calls into HyperPAD via the extension callback
  3960.                 mechanism. Using this mechanism, TSR programs can be invoked
  3961.                 in the following manner:
  3962.  
  3963.  
  3964.                 1. The TSR is invoked (possible via a key sequence).
  3965.  
  3966.  
  3967.                 2. The TSR checks to see if HyperPAD is installed. If so, the
  3968.                 TSR
  3969.                    registers itself with HyperPAD, passing HyperPAD the
  3970.                 address
  3971.                    of a routine to call when it is ready.
  3972.  
  3973.  
  3974.                 3. After registering, the TSR shuts down.
  3975.  
  3976.  
  3977.                 4. HyperPAD will call the TSR via this communicated address
  3978.                    after all pending handlers have stopped execution (during
  3979.                    the next idle message). The called procedure should follow
  3980.                    the C calling conventions, preserving DS, but using
  3981.                    HyperPAD's stack.
  3982.  
  3983.  
  3984.             Calling the TSR in this way insures a safe environment for the
  3985.             TSR. Further, the TSR program can use the callback mechanism
  3986.             available in HyperPAD to perform such tasks such as:
  3987.  
  3988.  
  3989.               o Showing/hiding the mouse
  3990.  
  3991.               o Make windows
  3992.  
  3993.               o Allocate/deallocate memory
  3994.  
  3995.               o Send messages to the current page
  3996.  
  3997.               o Change the paint layer of the current page and background
  3998.  
  3999.               o Access and change global variables
  4000.  
  4001.               o Access and change the contents of page or background fields
  4002.  
  4003.  
  4004.  
  4005.  
  4006.                                            HyperPAD 2.2 Addendum   67
  4007.        International Support
  4008.  
  4009.        Date Separator
  4010.  
  4011.  
  4012.             HyperPAD now uses the correct date separator corresponding to the
  4013.             country information reported by DOS. This affects the following:
  4014.  
  4015.  
  4016.               o The function date() now returns the date with the correct
  4017.                 date separator.
  4018.  
  4019.  
  4020.               o The convert command will use the correct separator if the
  4021.                 input date has no separator. Otherwise, the input date
  4022.                 separator character will be used in the target date string.
  4023.  
  4024.  
  4025.        Short Date Format
  4026.  
  4027.  
  4028.             The short date format is now returned using the country
  4029.             information returned by DOS. The following date formats are
  4030.             supported:
  4031.  
  4032.  
  4033.              m-d-y     USA
  4034.              d-m-y     Europe
  4035.              y-m-d     Japan
  4036.  
  4037.  
  4038.             This affects the following:
  4039.  
  4040.  
  4041.               o The function date()
  4042.  
  4043.  
  4044.               o The convert function when converting to and from the short
  4045.                 date format
  4046.  
  4047.  
  4048.  
  4049.  
  4050.  
  4051.  
  4052.  
  4053.  
  4054.  
  4055.  
  4056.  
  4057.  
  4058.  
  4059.  
  4060.  
  4061.  
  4062.  
  4063.  
  4064.        68 HyperPAD 2.2 Addendum
  4065.        International support in longFiles() function
  4066.  
  4067.  
  4068.             The longFiles() function now supports international date formats
  4069.             and date separator.
  4070.  
  4071.  
  4072.        Storing dates in your pads
  4073.  
  4074.  
  4075.             Because HyperPAD uses short date formats specific to the country
  4076.             reported by DOS, it is necessary to store dates in the seconds
  4077.             format in your pads and then convert them to the correct format
  4078.             for display. Thus, the ordering of the month, day, and year, and
  4079.             the date separator characters will be determined at runtime.
  4080.  
  4081.  
  4082.  
  4083.  
  4084.  
  4085.  
  4086.  
  4087.  
  4088.  
  4089.  
  4090.  
  4091.  
  4092.  
  4093.  
  4094.  
  4095.  
  4096.  
  4097.  
  4098.  
  4099.  
  4100.  
  4101.  
  4102.  
  4103.  
  4104.  
  4105.  
  4106.  
  4107.  
  4108.  
  4109.  
  4110.  
  4111.  
  4112.  
  4113.  
  4114.  
  4115.  
  4116.                                            HyperPAD 2.2 Addendum   69
  4117.        Miscellaneous Enhancements
  4118.  
  4119.        Support for Three button mice
  4120.  
  4121.  
  4122.             HyperPAD now supports three button mice. The mouseButton()
  4123.             function returns 4 if the middle button is currently pressed.
  4124.             Further, the middle button generates a mouseDown message.
  4125.  
  4126.  
  4127.        Overlay errors
  4128.  
  4129.  
  4130.             If HyperPAD is unable to load an overlay (either HPAD.OVL or
  4131.             HPAD22.OVL), the following error message will be displayed:
  4132.  
  4133.                Overlay error XX. Unable to load FILENAME.EXT.
  4134.  
  4135.  
  4136.             where XX is the overlay error number and FILENAME.EXT is the name
  4137.             of the overlay file that couldn't be loaded.
  4138.  
  4139.  
  4140.             The different overlay errors are:
  4141.  
  4142.              0    The user cancelled the "Where Is" dialog
  4143.                   box when HyperPAD couldn't find the overlay
  4144.                   file
  4145.              1    Overlay file was not found
  4146.              2    Overlay file couldn't be opened due to disk
  4147.                   error (such as no disk in drive, drive not
  4148.                   ready, or media errors)
  4149.              3    Overlay file couldn't be read properly --
  4150.                   the .OVL file is smashed.
  4151.              4    Overlay file couldn't be read due to disk
  4152.                   error
  4153.              5    Invalid file handle was returned by DOS
  4154.  
  4155.  
  4156.             When HyperPAD looks for an overlay for the first time, it
  4157.             performs the following tasks:
  4158.  
  4159.               1.Search the current directory.
  4160.  
  4161.  
  4162.               2.Search the directory specified by the HPADNET environment
  4163.                 variable, if this defined.
  4164.  
  4165.  
  4166.               3.Search the directory where HyperPAD was started.
  4167.  
  4168.  
  4169.               4.Search the directory containing HPAD.EXE.
  4170.  
  4171.  
  4172.               5.Search every directory specified in the DOS path.
  4173.  
  4174.  
  4175.        70 HyperPAD 2.2 Addendum
  4176.               6.Search on drive B:, if HyperPAD was started from low density
  4177.                 (360K) A:.
  4178.  
  4179.  
  4180.               7.If still unable to locate the overlay, HyperPAD will ask you
  4181.                 where the overlay is located using the "Where Is" dialog
  4182.                 box. This gives you a chance to specify exactly where the
  4183.                 overlay is located. If you cancel this dialog box, you will
  4184.                 receive error 0, listed above.
  4185.  
  4186.  
  4187.             When you exit HyperPAD, the directory containing the overlays is
  4188.             saved in the HPAD.INI file. Thus, the next time you load
  4189.             HyperPAD, no searches will have to be performed to find
  4190.             HyperPAD's overlays. However, be careful that you don't mix
  4191.             versions of HyperPAD, because an old INI file contains the path
  4192.             of the OLD overlay files, and if HyperPAD attempts to read in old
  4193.             overlay files, the computer will hang.
  4194.  
  4195.  
  4196.        Utility Enhancements
  4197.  
  4198.  
  4199.             PADINFO.EXE
  4200.  
  4201.  
  4202.             The PADINFO utility program now accepts a pad specification on
  4203.             the command line. For example:
  4204.  
  4205.  
  4206.                padinfo *.pad
  4207.  
  4208.  
  4209.                padinfo c:\pad\*.pad
  4210.  
  4211.  
  4212.                padinfo c:\pad\j*.pad
  4213.  
  4214.  
  4215.                padinfo home
  4216.  
  4217.  
  4218.                padinfo *
  4219.  
  4220.  
  4221.             PADINFO can be used to determine the version of HyperPAD that
  4222.             created the pad -- pads created by HyperPAD 2.2 return 7 as their
  4223.             version number.
  4224.  
  4225.  
  4226.  
  4227.  
  4228.  
  4229.  
  4230.  
  4231.  
  4232.  
  4233.  
  4234.  
  4235.  
  4236.                                            HyperPAD 2.2 Addendum   71
  4237.